コード例 #1
0
ファイル: QC6MonthReport.cs プロジェクト: jpreecedev/WebCal
        private static void AddAnswerSection(PDFDocument document, string question, bool answer, float left, float top, float width, float height)
        {
            AbsolutePositionText(document, question, left, top, width, height, document.GetRegularFont(false), Element.ALIGN_LEFT);

            if (answer)
            {
                document.FillBox(400, top - 25, 40, 25, BaseColor.LIGHT_GRAY);
            }
            else
            {
                document.DrawBox(400, top - 25, 40, 25);
            }

            if (!answer)
            {
                document.FillBox(450, top - 25, 40, 25, BaseColor.LIGHT_GRAY);
            }
            else
            {
                document.DrawBox(450, top - 25, 40, 25);
            }

            AbsolutePositionText(document, Resources.TXT_YES, 412, top - 1, 450, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_NO, 464, top - 1, 500, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
        }
コード例 #2
0
        protected Paragraph GetLicenseNumberParagraph(PDFDocument document, bool small)
        {
            Font smallFont   = small ? document.GetSmallFont(false) : document.GetRegularFont(false);
            Font regularFont = small ? document.GetSmallFont(true) : document.GetRegularFont(true);

            return(new Paragraph
            {
                new Chunk(Resources.TXT_LICENSE_NO_MINIMAL, smallFont),
                new Chunk(RegistrationData.SealNumber, regularFont)
            });
        }
コード例 #3
0
        protected override void CreateMediumLabel(PDFDocument document, TachographDocument tachographDocument)
        {
            var table = new PdfPTable(4)
            {
                TotalWidth = 266
            };

            table.SetWidths(new float[] { 108, 54, 54, 108 });

            GetWorkshopImage(document, table);
            document.AddSpannedCell(table, TrimDocumentType(tachographDocument.DocumentType), 2, document.GetSmallerFont(), 29);

            document.AddSpannedCell(table, string.Format(Resources.TXT_MEDIUM_W_FACTOR, tachographDocument.WFactor), 1, document.GetXSmallFont(false), 16);
            document.AddSpannedCell(table, string.Format(Resources.TXT_MEDIUM_K_FACTOR, tachographDocument.KFactor), 2, document.GetXSmallFont(false), 16);
            document.AddSpannedCell(table, string.Format(Resources.TXT_MEDIUM_L_FACTOR, tachographDocument.LFactor, Resources.TXT_MM), 1, document.GetXSmallFont(false), 16);

            document.AddSpannedCell(table, string.Format(Resources.TXT_MEDIUM_VIN, tachographDocument.VIN), 2, document.GetSmallFont(false), 16, 68);
            document.AddSpannedCell(table, string.Format(Resources.TXT_MEDIUM_TYRE_SIZE, tachographDocument.TyreSize), 2, document.GetSmallFont(false), 17, Element.ALIGN_LEFT);

            document.AddSpannedCell(table, string.Format(Resources.TXT_MEDIUM_SERIAL_NUMBER, tachographDocument.SerialNumber), 2, document.GetSmallFont(false), 17, Element.ALIGN_LEFT);
            document.AddSpannedCell(table, string.Format(Resources.TXT_MEDIUM_DATE, GetCalibrationTime(tachographDocument.CalibrationTime)), 2, document.GetRegularFont(false));

            GetCompanyDetails(document, table, 45, 4, document.GetRegularFont(false));
            document.AddSpannedCell(table, GetLicenseNumberParagraph(document, true), 4, 12, Element.ALIGN_LEFT);

            table.WriteSelectedRows(0, -1, document.Document.LeftMargin + 193, document.Height - 103, document.ContentByte);
        }
コード例 #4
0
        protected override void CreateSmallLabel(PDFDocument document, TachographDocument tachographDocument)
        {
            var table = new PdfPTable(4)
            {
                TotalWidth = 136
            };

            table.SetWidths(new float[] { 58, 10, 20, 48 });

            GetSmallImage(document, table);

            document.AddSpannedCell(table, TrimDocumentType(tachographDocument.DocumentType), 4, document.GetSmallerFont(), 21);

            document.AddSpannedCell(table, string.Format(Resources.TXT_SMALL_W_FACTOR, tachographDocument.WFactor), 2, document.GetXSmallFont(false), 20);
            document.AddSpannedCell(table, string.Format(Resources.TXT_SMALL_K_FACTOR, tachographDocument.KFactor), 2, document.GetXSmallFont(false), 20);

            document.AddSpannedCell(table, string.Format(Resources.TXT_SMALL_L_FACTOR, tachographDocument.LFactor, Resources.TXT_MM), 4, document.GetRegularFont(false), 20, 58);
            document.AddSpannedCell(table, string.Format(Resources.TXT_SMALL_TYRE_SIZE, tachographDocument.TyreSize), 4, document.GetSmallerFont(), 20, Element.ALIGN_LEFT);
            document.AddSpannedCell(table, string.Format(Resources.TXT_SMALL_VIN, tachographDocument.VIN), 4, document.GetSmallerFont(), 20, 68);
            document.AddSpannedCell(table, string.Format(Resources.TXT_SMALL_SERIAL_NUMBER, tachographDocument.SerialNumber), 4, document.GetSmallerFont(), 20, Element.ALIGN_LEFT);

            GetCompanyDetails(document, table, 85, 3, document.GetRegularFont(false));

            document.AddSpannedCell(table, string.Format(Resources.TXT_SMALL_DATE, GetCalibrationTime(tachographDocument.CalibrationTime)), 1, document.GetSmallFont(false));
            document.AddSpannedCell(table, GetLicenseNumberParagraph(document, false), 4, 20, Element.ALIGN_LEFT);

            table.WriteSelectedRows(0, -1, document.Document.LeftMargin + 2, document.Height - 103, document.ContentByte);
        }
コード例 #5
0
ファイル: StatusReport.cs プロジェクト: jpreecedev/WebCal
        private static void AddCell(PDFDocument document, PdfPTable table, string text, BaseColor color, bool bold)
        {
            var font = document.GetRegularFont(bold);

            font.Color = color;

            var cell = new PdfPCell(new Phrase(text, font))
            {
                MinimumHeight       = 22,
                HorizontalAlignment = Element.ALIGN_CENTER
            };

            table.AddCell(cell);
        }
コード例 #6
0
        public static void Create(PDFDocument document, UndownloadabilityDocument undownloadabilityDocument)
        {
            var settingsRepository    = ContainerBootstrapper.Resolve <ISettingsRepository <WorkshopSettings> >();
            WorkshopSettings settings = settingsRepository.GetWorkshopSettings();

            var rawData = ImageHelper.LoadFromResourcesAsByteArray("UndownloadHeader");

            document.AddImage(rawData, 390, 290, 59, document.Height - 350);

            AbsolutePositionText(document, settings.WorkshopName, 61, 710, 500, 50, document.GetLargeFont(true), Element.ALIGN_LEFT);
            AbsolutePositionText(document, settings.Address1, 61, 680, 500, 50, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, $"{settings.Town} {settings.PostCode}", 61, 645, 500, 50, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, undownloadabilityDocument.TachographMake, 61, 585, 500, 50, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, undownloadabilityDocument.TachographModel, 61, 548, 500, 50, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, undownloadabilityDocument.SerialNumber, 61, 510, 500, 50, document.GetRegularFont(false), Element.ALIGN_LEFT);

            string line1 = GetLine1Text(undownloadabilityDocument.TachographMake, undownloadabilityDocument.TachographModel, undownloadabilityDocument.SerialNumber, undownloadabilityDocument.RegistrationNumber);

            AbsolutePositionText(document, line1, 61, 450, 550, 50, document.GetLargerFont(false), Element.ALIGN_LEFT);

            string line2 = GetLine2Text();

            AbsolutePositionText(document, line2, 61, 405, 550, 50, document.GetLargerFont(false), Element.ALIGN_LEFT);

            string line3 = GetLine3Text();

            AbsolutePositionText(document, line3, 61, 375, 550, 100, document.GetLargerFont(false), Element.ALIGN_LEFT);

            string line4 = GetLine4Text();

            AbsolutePositionText(document, line4, 61, 310, 550, 100, document.GetLargerFont(false), Element.ALIGN_LEFT);

            document.DrawLine(50, 219, 545, 219);
            document.DrawLine(50, 147, 545, 147);
            document.DrawLine(125, 172, 238, 172);
            document.DrawLine(322, 172, 484, 172);

            if (undownloadabilityDocument.InspectionDate != null)
            {
                AbsolutePositionText(document, undownloadabilityDocument.InspectionDate.Value.ToString("dd.MM.yyyy"), 125, 195, 200, 20, document.GetSmallerFont(), Element.ALIGN_LEFT);
            }

            AbsolutePositionText(document, Resources.TXT_DATE, 125, 175, 200, 20, document.GetSmallerFont(), Element.ALIGN_LEFT);

            TryAddSignature(document, undownloadabilityDocument, 310, 158);
            AbsolutePositionText(document, string.Format(Resources.TXT_UNDOWNLOADABILITY_SIGNATURE, undownloadabilityDocument.Technician), 322, 175, 522, 20, document.GetSmallerFont(), Element.ALIGN_LEFT);
        }
コード例 #7
0
        protected override void CreateLargeLabel(PDFDocument document, TachographDocument tachographDocument, int startHorizontal, int startVertical)
        {
            AbsolutePositionText(document, Resources.TXT_CERTIFICATION_INSPECTION_SEALING_TACHOGRAPH_M1N1, (startHorizontal + 32), (startVertical + 0), 580, 100, document.GetXLargeFont(false), Element.ALIGN_CENTER);

            //Outlining
            DrawLargeLabelRectangle(document, startHorizontal, startVertical);

            document.DrawLine((startHorizontal + 50), (startVertical + 106), (startHorizontal + 545), (startVertical + 106), TotalPageHeight);
            document.DrawLine((startHorizontal + 50), (startVertical + 192), (startHorizontal + 545), (startVertical + 192), TotalPageHeight);
            document.DrawLine((startHorizontal + 50), (startVertical + 247), (startHorizontal + 545), (startVertical + 247), TotalPageHeight);
            document.DrawLine((startHorizontal + 150), (startVertical + 344), (startHorizontal + 298), (startVertical + 344), TotalPageHeight);
            document.DrawLine((startHorizontal + 347), (startVertical + 344), (startHorizontal + 494), (startVertical + 344), TotalPageHeight);

            AbsolutePositionText(document, Resources.TXT_TACHOGRAPH, (startHorizontal + 50), (startVertical + 52), 150, 20);
            AbsolutePositionText(document, Resources.TXT_VEHICLE, (startHorizontal + 50), (startVertical + 137), 150, 20);
            AbsolutePositionText(document, Resources.TXT_M1N1_ADAPTER, (startHorizontal + 50), (startVertical + 208), 150, 20);
            AbsolutePositionText(document, Resources.TXT_TECHNICIAN, (startHorizontal + 50), (startVertical + 270), 150, 20);
            AbsolutePositionText(document, Resources.TXT_DATE, (startHorizontal + 150), (startVertical + 340), 200, 20);

            TryAddSignature(document, tachographDocument, (startHorizontal + 330));
            AbsolutePositionText(document, string.Format(Resources.TXT_SIGNATURE_TECHNICIAN, tachographDocument.Technician), (startHorizontal + 347), (startVertical + 340), 550, 20);

            //Tachograph
            AbsolutePositionText(document, Resources.TXT_MAKE, (startHorizontal + 150), (startVertical + 20), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYPE, (startHorizontal + 347), (startVertical + 20), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.TachographMake, (startHorizontal + 150), (startVertical + 32), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, tachographDocument.TachographModel, (startHorizontal + 347), (startVertical + 32), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, Resources.TXT_ODOMETER_READING, (startHorizontal + 150), (startVertical + 46), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_SERIAL_NUMBER, (startHorizontal + 347), (startVertical + 46), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.OdometerReading, (startHorizontal + 150), (startVertical + 58), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, tachographDocument.SerialNumber, (startHorizontal + 347), (startVertical + 58), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, Resources.TXT_SET_K_FACTOR, (startHorizontal + 150), (startVertical + 72), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.KFactor, (startHorizontal + 150), (startVertical + 84), 550, 72, document.GetLargerFont(false));

            //Vehicle

            AbsolutePositionText(document, Resources.TXT_MAKE_AND_MODEL, (startHorizontal + 150), (startVertical + 104), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_VRN, (startHorizontal + 347), (startVertical + 104), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, string.Format("{0} {1}", tachographDocument.VehicleMake, tachographDocument.VehicleModel), (startHorizontal + 150), (startVertical + 116), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, tachographDocument.RegistrationNumber, (startHorizontal + 347), (startVertical + 116), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, Resources.TXT_VIN, (startHorizontal + 150), (startVertical + 130), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYRE_SIZE, (startHorizontal + 347), (startVertical + 130), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, tachographDocument.VIN, (startHorizontal + 150), (startVertical + 142), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, tachographDocument.TyreSize, (startHorizontal + 347), (startVertical + 142), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, Resources.TXT_W_FACTOR, (startHorizontal + 150), (startVertical + 156), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYRE_L_FACTOR, (startHorizontal + 347), (startVertical + 156), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, string.Format(Resources.TXT_IMP_KM, tachographDocument.WFactor), (startHorizontal + 150), (startVertical + 168), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, string.Format(Resources.TXT_MM, tachographDocument.LFactor), (startHorizontal + 347), (startVertical + 168), 550, 72, document.GetLargerFont(false));

            //M1N1 Adapter

            AbsolutePositionText(document, Resources.TXT_M1N1_SERIAL_NUMBER, (startHorizontal + 150), (startVertical + 188), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_COLOR, (startHorizontal + 347), (startVertical + 188), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, tachographDocument.TachographAdapterSerialNumber, (startHorizontal + 150), (startVertical + 200), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, tachographDocument.TachographCableColor, (startHorizontal + 347), (startVertical + 200), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, Resources.TXT_LOCATION, (startHorizontal + 150), (startVertical + 214), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, tachographDocument.TachographAdapterLocation, (startHorizontal + 150), (startVertical + 226), 550, 72, document.GetLargerFont(false));

            //Technician

            AbsolutePositionText(document, RegistrationData.CompanyName, (startHorizontal + 150), (startVertical + 246), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, WorkshopSettings.Address1, (startHorizontal + 150), (startVertical + 270), 550, 72, document.GetLargerFont(false));
            AbsolutePositionText(document, string.Format("{0} {1}", WorkshopSettings.Town, WorkshopSettings.PostCode), (startHorizontal + 150), (startVertical + 284), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, string.Format(Resources.TXT_DISTRIBUTOR_SEAL, RegistrationData.SealNumber), (startHorizontal + 347), (startVertical + 246), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, GetCalibrationTime(tachographDocument.CalibrationTime), (startHorizontal + 150), (startVertical + 324), 250, 40, document.GetLargerFont(false));
        }
コード例 #8
0
        protected override void CreateLargeCertificate(PDFDocument document, TachographDocument tachographDocument, bool excludeLogos)
        {
            const int startHorizontal = 20;
            const int startVertical   = 0;

            document.DrawLine((startHorizontal), (startVertical), (startHorizontal + 555), (startVertical), TotalPageHeight);

            document.DrawLine((startHorizontal), (startVertical), (startHorizontal), (startVertical + 800), TotalPageHeight);

            document.DrawLine((startHorizontal + 555), (startVertical), (startHorizontal + 555), (startVertical + 800), TotalPageHeight);

            document.DrawLine((startHorizontal), (startVertical + 800), (startHorizontal + 555), (startVertical + 800), TotalPageHeight);

            document.DrawLine((startHorizontal), (startVertical + 290), (startHorizontal + 555), (startVertical + 290), TotalPageHeight);

            if (tachographDocument.MinorWorkDetails == null)
            {
                document.DrawLine((startHorizontal), (startVertical + 400), (startHorizontal + 555), (startVertical + 400), TotalPageHeight);
                document.DrawLine((startHorizontal), (startVertical + 600), (startHorizontal + 555), (startVertical + 600), TotalPageHeight);
            }
            else
            {
                document.DrawLine((startHorizontal), (startVertical + 420), (startHorizontal + 555), (startVertical + 420), TotalPageHeight);
                document.DrawLine((startHorizontal), (startVertical + 630), (startHorizontal + 555), (startVertical + 630), TotalPageHeight);
            }

            if (WorkshopSettings.Image != null && !excludeLogos)
            {
                var image = ImageHelper.Scale(WorkshopSettings.RawImage.ToImage(), 545, 150);
                document.AddImage(image, image.Width, image.Height, startHorizontal + 5, startVertical + 660);
            }

            AbsolutePositionText(document, Resources.TXT_TACHOGRAPH_CALIBRATION_CERTIFICATE.ToUpper(), startHorizontal + 200, startVertical + 170, 580, 100, document.GetRegularFont(true));
            document.DrawLine(startHorizontal + 200, startVertical + 188, startHorizontal + 367, startVertical + 188, TotalPageHeight);

            if (CustomerContact != null)
            {
                AbsolutePositionText(document, Resources.TXT_CUSTOMER_DETAILS.ToUpper(), startHorizontal + 5, startVertical + 200, 200, 40, document.GetRegularFont(true));
                if (CustomerContact.Name != null)
                {
                    AbsolutePositionText(document, CustomerContact.Name.ToUpper(), startHorizontal + 5, startVertical + 220, 200, 40, document.GetRegularFont(false));
                }
                if (CustomerContact.Address != null)
                {
                    AbsolutePositionText(document, CustomerContact.Address.ToUpper(), startHorizontal + 5, startVertical + 230, 200, 40, document.GetRegularFont(false));
                }
                if (CustomerContact.Town != null)
                {
                    AbsolutePositionText(document, CustomerContact.Town.ToUpper(), startHorizontal + 5, startVertical + 240, 200, 40, document.GetRegularFont(false));
                }
                if (CustomerContact.PostCode != null)
                {
                    AbsolutePositionText(document, CustomerContact.PostCode.ToUpper(), startHorizontal + 5, startVertical + 250, 200, 40, document.GetRegularFont(false));
                }
            }

            if (!string.IsNullOrEmpty(tachographDocument.InvoiceNumber))
            {
                AbsolutePositionText(document, Resources.TXT_INVOICE_NUMBER.ToUpper(), startHorizontal + 287, startVertical + 240, 400, 40, document.GetRegularFont(true));
                AbsolutePositionText(document, tachographDocument.InvoiceNumber, startHorizontal + 540, startVertical + 240, 390, 40, document.GetRegularFont(false));
            }
            if (!string.IsNullOrEmpty(tachographDocument.VehicleType))
            {
                AbsolutePositionText(document, Resources.TXT_VEHICLE_TYPE.ToUpper(), startHorizontal + 299, startVertical + 250, 400, 40, document.GetRegularFont(true));
                AbsolutePositionText(document, tachographDocument.VehicleType, startHorizontal + 490, startVertical + 250, 390, 40, document.GetRegularFont(false));
            }

            DateTime?calibrationDate = tachographDocument.CalibrationTime ?? DateTime.Today;
            string   expiryDate      = GetCalibrationTime(calibrationDate.Value.AddYears(2).AddDays(-1));

            AbsolutePositionText(document, Resources.TXT_DATE.ToUpper(), startHorizontal + 370, (startVertical + 210), 355, 40, document.GetRegularFont(true));

            AbsolutePositionText(document, GetCalibrationTime(tachographDocument.CalibrationTime).ToUpper(), (startHorizontal + 450), (startVertical + 210), 390, 40, document.GetRegularFont(false));

            if (tachographDocument.DocumentType != Resources.TXT_MINOR_WORK_DETAILS && tachographDocument.IsDigital)
            {
                AbsolutePositionText(document, Resources.TXT_EXP.ToUpper(), startHorizontal + 260, (startVertical + 220), 400, 40, document.GetRegularFont(true));
                AbsolutePositionText(document, expiryDate.ToUpper(), (startHorizontal + 450), (startVertical + 220), 390, 40, document.GetRegularFont(false));
            }

            AbsolutePositionText(document, Resources.TXT_ANALOGUE_INSPECTIONS.ToUpper(), (startHorizontal + 5), (startVertical + 300), 590, 40, document.GetRegularFont(true));

            AbsolutePositionText(document, Resources.TXT_CALIBRATION.ToUpper(), (startHorizontal + 15), (startVertical + 310), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 5), (startVertical + 320), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_INSTALLATION)
            {
                document.DrawCheck((startHorizontal + 5), (startVertical + 320), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_2_YEAR.ToUpper(), (startHorizontal + 15), (startVertical + 320), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 5), (startVertical + 330), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_TWO_YEAR_INSPECTION)
            {
                document.DrawCheck((startHorizontal + 5), (startVertical + 330), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_6_YEAR.ToUpper(), (startHorizontal + 15), (startVertical + 330), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 5), (startVertical + 340), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_SIX_YEAR_CALIBRATION)
            {
                document.DrawCheck((startHorizontal + 5), (startVertical + 340), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_RECALIBRATION_CERTIFICATE.ToUpper(), (startHorizontal + 15), (startVertical + 340), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 5), (startVertical + 350), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_RECALIBRATION)
            {
                document.DrawCheck((startHorizontal + 5), (startVertical + 350), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_MINOR_WORK.ToUpper(), (startHorizontal + 15),
                                 (startVertical + 350), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 5), (startVertical + 360), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_MINOR_WORK && !tachographDocument.IsDigital)
            {
                document.DrawCheck((startHorizontal + 5), (startVertical + 360), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_DIGITAL_INSPECTIONS.ToUpper(), (startHorizontal + 240), (startVertical + 300), 590, 40, document.GetRegularFont(true));

            AbsolutePositionText(document, Resources.TXT_CALIBRATION.ToUpper(), (startHorizontal + 255), (startVertical + 310), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 240), (startVertical + 320), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_DIGITAL_INITIAL)
            {
                document.DrawCheck((startHorizontal + 240), (startVertical + 320), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_2_YEAR.ToUpper(), (startHorizontal + 255),
                                 (startVertical + 320), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 240), (startVertical + 330), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_DIGITAL_TWO_YEAR)
            {
                document.DrawCheck((startHorizontal + 240), (startVertical + 330), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_MINOR_WORK.ToUpper(), (startHorizontal + 255), (startVertical + 330), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 240), (startVertical + 340), TotalPageHeight);
            if (tachographDocument.DocumentType == Resources.TXT_LARGE_MINOR_WORK && tachographDocument.IsDigital)
            {
                document.DrawCheck((startHorizontal + 240), (startVertical + 340), TotalPageHeight);
            }

            AbsolutePositionText(document, Resources.TXT_NEW_BATTERY.ToUpper(), (startHorizontal + 255), (startVertical + 350), 590, 40, document.GetRegularFont(false));
            document.DrawCheckBox((startHorizontal + 240), (startVertical + 360), TotalPageHeight);
            if (tachographDocument.NewBattery)
            {
                document.DrawCheck((startHorizontal + 240), (startVertical + 360), TotalPageHeight);
            }

            if (tachographDocument.MinorWorkDetails != null)
            {
                AbsolutePositionText(document, Resources.TXT_MINOR_WORK_DETAILS_DETAILS.ToUpper(), (startHorizontal + 5), (startVertical + 370), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, tachographDocument.MinorWorkDetails.ToUpper(), (startHorizontal + 5), (startVertical + 380), 550, 72);
            }

            if (tachographDocument.MinorWorkDetails == null)
            {
                AbsolutePositionText(document, Resources.TXT_TACHOGRAPH.ToUpper(), (startHorizontal + 5), (startVertical + 410), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_MAKE.ToUpper(), (startHorizontal + 140), (startVertical + 430), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_TYPE.ToUpper(), (startHorizontal + 140), (startVertical + 440), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_SERIAL_NUMBER.ToUpper(), (startHorizontal + 140), (startVertical + 450), 550, 72, document.GetRegularFont(true));

                if (!string.IsNullOrEmpty(tachographDocument.TachographMake))
                {
                    AbsolutePositionText(document, tachographDocument.TachographMake.ToUpper(), (startHorizontal + 300), (startVertical + 430), 550, 72);
                }
                if (!string.IsNullOrEmpty(tachographDocument.TachographModel))
                {
                    AbsolutePositionText(document, tachographDocument.TachographModel.ToUpper(), (startHorizontal + 300), (startVertical + 440), 550, 72);
                }
                if (!string.IsNullOrEmpty(tachographDocument.SerialNumber))
                {
                    AbsolutePositionText(document, tachographDocument.SerialNumber.ToUpper(), (startHorizontal + 300), (startVertical + 450), 550, 72);
                }

                AbsolutePositionText(document, Resources.TXT_VEHICLE.ToUpper(), (startHorizontal + 5), (startVertical + 470), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, Resources.TXT_VRN.ToUpper(), (startHorizontal + 140), (startVertical + 490), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_VIN.ToUpper(), (startHorizontal + 140), (startVertical + 500), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_TYRE_SIZE.ToUpper(), (startHorizontal + 140), (startVertical + 510), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_W_FACTOR.ToUpper(), (startHorizontal + 140), (startVertical + 520), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_TYRE_L_FACTOR.ToUpper(), (startHorizontal + 140), (startVertical + 530), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_ODOMETER_READING.ToUpper(), (startHorizontal + 140), (startVertical + 540), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_SET_K_FACTOR.ToUpper(), (startHorizontal + 140), (startVertical + 550), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, $"{tachographDocument.VehicleMake} {tachographDocument.VehicleModel}".ToUpper(), (startHorizontal + 140), (startVertical + 480), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, tachographDocument.RegistrationNumber.ToUpper(), (startHorizontal + 300), (startVertical + 490), 550, 72);
                AbsolutePositionText(document, tachographDocument.VIN.ToUpper(), (startHorizontal + 300), (startVertical + 500), 550, 72);
                AbsolutePositionText(document, tachographDocument.TyreSize.ToUpper(), (startHorizontal + 300), (startVertical + 510), 550, 72);
                AbsolutePositionText(document, string.Format(Resources.TXT_IMP_KM, tachographDocument.WFactor).ToUpper(), (startHorizontal + 300), (startVertical + 520), 550, 72);
                AbsolutePositionText(document, string.Format(Resources.TXT_MM, tachographDocument.LFactor).ToUpper(), (startHorizontal + 300), (startVertical + 530), 550, 72);
                AbsolutePositionText(document, tachographDocument.OdometerReading.ToUpper(), (startHorizontal + 300), (startVertical + 540), 550, 72);
                AbsolutePositionText(document, string.Format(Resources.TXT_IMP_KM, tachographDocument.KFactor).ToUpper(), (startHorizontal + 300), (startVertical + 550), 550, 72);

                if (tachographDocument.MinorWorkDetails != null)
                {
                    AbsolutePositionText(document, Resources.TXT_MINOR_WORK_DETAILS_DETAILS.ToUpper(), (startHorizontal + 140), (startVertical + 570), 550, 72, document.GetRegularFont(true));
                    AbsolutePositionText(document, tachographDocument.MinorWorkDetails.ToUpper(), (startHorizontal + 140), (startVertical + 580), 550, 72);
                }

                AbsolutePositionText(document, Resources.TXT_AUTHORISED_TACHOGRAPH_CENTER, (startHorizontal + 30), (startVertical + 620), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, RegistrationData.CompanyName, (startHorizontal + 30), (startVertical + 650), 550, 72, document.GetRegularFont(false));

                AbsolutePositionText(document, WorkshopSettings.Address1, (startHorizontal + 30), (startVertical + 670), 550, 72, document.GetRegularFont(false));

                AbsolutePositionText(document, WorkshopSettings.Town, (startHorizontal + 30), (startVertical + 690), 550, 72, document.GetRegularFont(false));

                AbsolutePositionText(document, WorkshopSettings.PostCode, (startHorizontal + 30), (startVertical + 710), 550, 72, document.GetRegularFont(false));

                AbsolutePositionText(document, Resources.TXT_AUTHORISED_TESTERS_SIGNATURE, (startHorizontal + 300), (startVertical + 620), 700, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, string.Format(Resources.TXT_SIGNATURE_TECHNICIAN, tachographDocument.Technician), (startHorizontal + 300), (startVertical + 650), 550, 20);

                TryAddSignature(document, tachographDocument, (startHorizontal + 300));

                document.DrawLine((startHorizontal + 300), (startVertical + 715), (startHorizontal + 490), (startVertical + 715), TotalPageHeight);
                AbsolutePositionText(document, string.Format(Resources.TXT_DISTRIBUTOR_SEAL, RegistrationData.SealNumber), (startHorizontal + 300), (startVertical + 710), 550, 72, document.GetXSmallFont(false));

                AddAdvertisingSection(document, startHorizontal, startVertical);
            }
            else
            {
                AbsolutePositionText(document, Resources.TXT_TACHOGRAPH.ToUpper(), (startHorizontal + 5), (startVertical + 430), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_MAKE.ToUpper(), (startHorizontal + 140), (startVertical + 450), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_TYPE.ToUpper(), (startHorizontal + 140), (startVertical + 460), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_SERIAL_NUMBER.ToUpper(), (startHorizontal + 140), (startVertical + 470), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, tachographDocument.TachographMake.ToUpper(), (startHorizontal + 300), (startVertical + 450), 550, 72);
                AbsolutePositionText(document, tachographDocument.TachographModel.ToUpper(), (startHorizontal + 300), (startVertical + 460), 550, 72);
                AbsolutePositionText(document, tachographDocument.SerialNumber.ToUpper(), (startHorizontal + 300), (startVertical + 470), 550, 72);

                AbsolutePositionText(document, Resources.TXT_VEHICLE.ToUpper(), (startHorizontal + 5), (startVertical + 490), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, Resources.TXT_VRN.ToUpper(), (startHorizontal + 140), (startVertical + 510), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_VIN.ToUpper(), (startHorizontal + 140), (startVertical + 520), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_TYRE_SIZE.ToUpper(), (startHorizontal + 140), (startVertical + 530), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_W_FACTOR.ToUpper(), (startHorizontal + 140), (startVertical + 540), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_TYRE_L_FACTOR.ToUpper(), (startHorizontal + 140), (startVertical + 550), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_ODOMETER_READING.ToUpper(), (startHorizontal + 140), (startVertical + 560), 550, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, Resources.TXT_SET_K_FACTOR.ToUpper(), (startHorizontal + 140), (startVertical + 570), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, string.Format("{0} {1}", tachographDocument.VehicleMake, tachographDocument.VehicleModel).ToUpper(), (startHorizontal + 140), (startVertical + 500), 550, 72, document.GetRegularFont(true));

                AbsolutePositionText(document, tachographDocument.RegistrationNumber.ToUpper(), (startHorizontal + 300), (startVertical + 510), 550, 72);
                AbsolutePositionText(document, tachographDocument.VIN.ToUpper(), (startHorizontal + 300), (startVertical + 520), 550, 72);
                AbsolutePositionText(document, tachographDocument.TyreSize.ToUpper(), (startHorizontal + 300), (startVertical + 530), 550, 72);
                AbsolutePositionText(document, string.Format(Resources.TXT_IMP_KM, tachographDocument.WFactor).ToUpper(), (startHorizontal + 300), (startVertical + 540), 550, 72);
                AbsolutePositionText(document, string.Format(Resources.TXT_MM, tachographDocument.LFactor).ToUpper(), (startHorizontal + 300), (startVertical + 550), 550, 72);
                AbsolutePositionText(document, tachographDocument.OdometerReading.ToUpper(), (startHorizontal + 300), (startVertical + 560), 550, 72);
                AbsolutePositionText(document, string.Format(Resources.TXT_IMP_KM, tachographDocument.KFactor).ToUpper(), (startHorizontal + 300), (startVertical + 570), 550, 72);

                AbsolutePositionText(document, Resources.TXT_AUTHORISED_TACHOGRAPH_CENTER, (startHorizontal + 30), (startVertical + 640), 550, 72, document.GetRegularFont(true));
                if (RegistrationData.CompanyName != null)
                {
                    AbsolutePositionText(document, RegistrationData.CompanyName, (startHorizontal + 30), (startVertical + 670), 550, 72, document.GetRegularFont(false));
                }
                if (WorkshopSettings.Address1 != null)
                {
                    AbsolutePositionText(document, WorkshopSettings.Address1, (startHorizontal + 30), (startVertical + 690), 550, 72, document.GetRegularFont(false));
                }
                if (WorkshopSettings.Town != null)
                {
                    AbsolutePositionText(document, WorkshopSettings.Town, (startHorizontal + 30), (startVertical + 710), 550, 72, document.GetRegularFont(false));
                }

                if (WorkshopSettings.PostCode != null)
                {
                    AbsolutePositionText(document, WorkshopSettings.PostCode, (startHorizontal + 30), (startVertical + 730), 550, 72, document.GetRegularFont(false));
                }

                AbsolutePositionText(document, Resources.TXT_AUTHORISED_TESTERS_SIGNATURE, (startHorizontal + 300), (startVertical + 640), 700, 72, document.GetRegularFont(true));
                AbsolutePositionText(document, string.Format(Resources.TXT_SIGNATURE_TECHNICIAN, tachographDocument.Technician), (startHorizontal + 300), (startVertical + 670), 550, 20);

                TryAddSignature(document, tachographDocument, (startHorizontal + 300));

                document.DrawLine((startHorizontal + 300), (startVertical + 735), (startHorizontal + 490), (startVertical + 735), TotalPageHeight);
                AbsolutePositionText(document, string.Format(Resources.TXT_DISTRIBUTOR_SEAL, RegistrationData.SealNumber), (startHorizontal + 300), (startVertical + 730), 550, 72, document.GetXSmallFont(false));

                AddAdvertisingSection(document, startHorizontal, startVertical);
            }
        }
コード例 #9
0
        public static void Create(PDFDocument document, QCReportViewModel qcReportDocument)
        {
            var settingsRepository = ContainerBootstrapper.Resolve <ISettingsRepository <WorkshopSettings> >();
            var settings           = settingsRepository.GetWorkshopSettings();

            AddImageFromResource(document, "skillray_small", 61, 770);
            AddImageFromResource(document, "traintec_small", 350, 770);

            AbsolutePositionText(document, Resources.TXT_QC_CHECK_REPORT_TACHO_CENTRE_DETAILS, 61, 747, 500, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            document.DrawBox(105, 700, 380, 25);
            AbsolutePositionText(document, settings.WorkshopName, 110, 725, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(105, 675, 380, 25);
            AbsolutePositionText(document, settings.Address1, 110, 700, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(105, 650, 380, 25);
            AbsolutePositionText(document, settings.Address2, 110, 675, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(105, 625, 380, 25);
            AbsolutePositionText(document, settings.Town, 110, 650, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(105, 600, 380, 25);
            AbsolutePositionText(document, settings.PostCode, 110, 625, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_TACHO_MANAGER_NAME, 61, 580, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 555, 250, 25);
            AbsolutePositionText(document, qcReportDocument.TachoManagerName, 305, 580, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_QC_MANAGER_NAME, 61, 540, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 515, 250, 25);
            AbsolutePositionText(document, qcReportDocument.QCManagerName, 305, 540, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_TECHNICIAN_NAME, 61, 500, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 475, 250, 25);
            AbsolutePositionText(document, qcReportDocument.TechnicianName, 305, 500, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_DATE_OF_AUDIT, 61, 460, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 435, 250, 25);
            AbsolutePositionText(document, qcReportDocument.DateOfAudit.ToString(Constants.ShortYearDateFormat), 305, 460, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_TYPE_OF_CHECK, 61, 410, 480, 25, document.GetLargeFont(true), Element.ALIGN_LEFT);

            AbsolutePositionText(document, QCReportViewModel.InitialInstallationAnalogue, 61, 380, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 355, 40, 25);
            AbsolutePositionText(document, qcReportDocument.IsDocumentType(QCReportViewModel.InitialInstallationAnalogue) ? Resources.TXT_X : string.Empty, 315, 379, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, QCReportViewModel.SixYearCalibrationAnalogue, 61, 350, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 325, 40, 25);
            AbsolutePositionText(document, qcReportDocument.IsDocumentType(QCReportViewModel.SixYearCalibrationAnalogue) ? Resources.TXT_X : string.Empty, 315, 349, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, QCReportViewModel.TwoYearInspectionAnalogue, 61, 320, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 295, 40, 25);
            AbsolutePositionText(document, qcReportDocument.IsDocumentType(QCReportViewModel.TwoYearInspectionAnalogue) ? Resources.TXT_X : string.Empty, 315, 319, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, QCReportViewModel.InitialInstallationDigital, 61, 275, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 250, 40, 25);
            AbsolutePositionText(document, qcReportDocument.IsDocumentType(QCReportViewModel.InitialInstallationDigital) ? Resources.TXT_X : string.Empty, 315, 274, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, QCReportViewModel.TwoYearCalibrationDigital, 61, 245, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 220, 40, 25);
            AbsolutePositionText(document, qcReportDocument.IsDocumentType(QCReportViewModel.TwoYearCalibrationDigital) ? Resources.TXT_X : string.Empty, 315, 244, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_TACHOGRAPH_DETAILS, 61, 195, 480, 25, document.GetLargeFont(true), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_TACHO_MAKE, 61, 168, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 145, 250, 25);
            AbsolutePositionText(document, qcReportDocument.TachographMake, 305, 169, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_TACHO_TYPE, 61, 145, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 120, 250, 25);
            AbsolutePositionText(document, qcReportDocument.TachographModel, 305, 145, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_TACHO_SERIAL, 61, 118, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 95, 250, 25);
            AbsolutePositionText(document, qcReportDocument.TachographSerialNumber, 305, 119, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.AddPage();

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_VEHICLE_DETAILS, 61, 767, 500, 25, document.GetLargeFont(true), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_TACHO_MAKE, 61, 740, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 715, 250, 25);
            AbsolutePositionText(document, qcReportDocument.VehicleMake, 305, 740, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_VEHICLE_TYPE, 61, 715, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 690, 250, 25);
            AbsolutePositionText(document, qcReportDocument.VehicleType, 305, 715, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_VEHICLE_REGISTRATION, 61, 690, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 665, 250, 25);
            AbsolutePositionText(document, qcReportDocument.VehicleRegistrationNumber, 305, 690, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_VIN, 61, 665, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 640, 250, 25);
            AbsolutePositionText(document, qcReportDocument.VehicleIdentificationNumber, 305, 665, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_CALIBRATION_INSPECTION, 61, 625, 500, 25, document.GetLargeFont(true), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_3_BASIC_CHECKS_COMPLETED, 61, 605, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 580, 40, 25);
            AbsolutePositionText(document, qcReportDocument.ThreeBasicChecksCompleted ? Resources.TXT_X : string.Empty, 315, 605, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_ESTABLISH_W_FACTOR, 61, 570, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 545, 80, 25);
            AbsolutePositionText(document, qcReportDocument.WFactor == null ? string.Empty : qcReportDocument.WFactor.ToString(), 310, 570, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_IMP_KM, 390, 570, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_ESTABLISH_L, 61, 545, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 520, 80, 25);
            AbsolutePositionText(document, qcReportDocument.LFactor == null ? string.Empty : qcReportDocument.LFactor.ToString(), 310, 545, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_MM, 390, 545, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_K_FACTOR, 61, 520, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 495, 80, 25);
            AbsolutePositionText(document, qcReportDocument.KFactor == null ? string.Empty : qcReportDocument.KFactor.ToString(), 310, 520, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_IMP_KM, 390, 520, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_40_KM_TEST, 61, 495, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 470, 80, 25);
            AbsolutePositionText(document, qcReportDocument.FortyKmTest ?? string.Empty, 310, 495, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_KMH, 390, 495, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_60_KM_TEST, 61, 470, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);
            document.DrawBox(300, 445, 80, 25);
            AbsolutePositionText(document, qcReportDocument.SixtyKmTest ?? string.Empty, 310, 470, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_KMH, 390, 470, 480, 25, document.GetLargeFont(false), Element.ALIGN_LEFT);

            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_CLOCK_TEST_COMPLETED, true, qcReportDocument.ClockTestCompleted, 61, 425, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_BENCH_TEST_CARRIED_OUT, true, qcReportDocument.BenchTestCarriedOutAnalogue, 61, 390, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_FUNCTIONAL_BENCH_TEST, true, qcReportDocument.FunctionalBenchTestDigital, 61, 355, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_DISTANCE_CHECK_CARRIED_OUT, true, qcReportDocument.DistanceCheckCarriedOut, 61, 320, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_TEST_CHARTS_COMPLETED, true, qcReportDocument.TestChartsCompleted, 61, 285, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_SPEED_FOR_SPEED_CHECK, true, qcReportDocument.SpeedForSpeedCheckCompleted, 61, 250, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_SYSTEM_SEALED_IN_ACCORDANCE, false, qcReportDocument.SystemSealedInAccordance, 61, 215, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_CALIBRATION_CERTIFICATE_COMPLETED, false, qcReportDocument.CalibrationCertificateCompleted, 61, 180, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_REFERENCE_CABLE_CHECK, true, qcReportDocument.ReferenceCableCheckCompleted, 61, 145, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_TECHNICAL_DATA_PRINTOUTS, true, qcReportDocument.TechnicalDataPrintoutsCreated, 61, 110, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_REPORT_CHECK_EVENTS_FAULTS_READ, true, qcReportDocument.EventsFaultsReadCleared, 61, 75, 480, 25);

            document.AddPage();

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_COMMENTS, 61, 767, 500, 25, document.GetLargeFont(true), Element.ALIGN_LEFT);

            document.DrawBox(105, 525, 380, 200);
            AbsolutePositionText(document, qcReportDocument.Comments, 110, 515, 480, 730, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(200, 465, 50, 40);
            document.DrawBox(350, 465, 50, 40);

            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_PASS, 155, 500, 255, 35, document.GetLargeFont(true), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_FAIL, 315, 500, 415, 35, document.GetLargeFont(true), Element.ALIGN_LEFT);

            if (qcReportDocument.Passed)
            {
                AbsolutePositionText(document, Resources.TXT_X, 219, 500, 255, 35, document.GetXLargeFont(true), Element.ALIGN_LEFT);
            }
            if (!qcReportDocument.Passed)
            {
                AbsolutePositionText(document, Resources.TXT_X, 369, 500, 405, 35, document.GetXLargeFont(true), Element.ALIGN_LEFT);
            }

            document.DrawBox(61, 350, 225, 35);
            AbsolutePositionText(document, $"{Resources.TXT_QC_REPORT_CHECK_TECHNICIAN} {qcReportDocument.TechnicianName}", 65, 380, 255, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(310, 350, 225, 35);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_SIGNATURE, 315, 380, 450, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            TryAddSignature(document, qcReportDocument.TechnicianName, 345, 340);

            document.DrawBox(61, 300, 225, 35);
            AbsolutePositionText(document, $"{Resources.TXT_QC_REPORT_CHECK_QC} {qcReportDocument.QCManagerName}", 65, 330, 255, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(310, 300, 225, 35);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_SIGNATURE, 315, 330, 450, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            TryAddSignature(document, qcReportDocument.QCManagerName, 345, 290);

            document.DrawBox(61, 250, 225, 35);
            AbsolutePositionText(document, Resources.DATE + DateTime.Now.ToString(Constants.ShortYearDateFormat), 65, 280, 255, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
        }
コード例 #10
0
ファイル: FullCertificate.cs プロジェクト: jpreecedev/WebCal
        protected override void CreateLargeCertificate(PDFDocument document, TachographDocument tachographDocument, bool excludeLogos)
        {
            const int startHorizontal = 0;
            const int startVertical   = 0;

            document.DrawLine((startHorizontal), (startVertical), (startHorizontal + 545), (startVertical), TotalPageHeight);

            document.DrawLine((startHorizontal), (startVertical), (startHorizontal), (startVertical + 790), TotalPageHeight);

            document.DrawLine((startHorizontal + 545), (startVertical), (startHorizontal + 545), (startVertical + 790), TotalPageHeight);

            document.DrawLine((startHorizontal), (startVertical + 790), (startHorizontal + 545), (startVertical + 790), TotalPageHeight);

            document.DrawLine((startHorizontal), (startVertical + 290), (startHorizontal + 545), (startVertical + 290), TotalPageHeight);
            document.DrawLine((startHorizontal), (startVertical + 400), (startHorizontal + 545), (startVertical + 400), TotalPageHeight);
            document.DrawLine((startHorizontal), (startVertical + 600), (startHorizontal + 545), (startVertical + 600), TotalPageHeight);

            if (WorkshopSettings.Image != null && !excludeLogos)
            {
                const float profileImageMaxHeight = 150;
                const float profileImageMaxWidth  = 200;

                float widthScale  = profileImageMaxWidth / WorkshopSettings.Image.Width;
                float heightScale = profileImageMaxHeight / WorkshopSettings.Image.Height;
                float scale       = Math.Min(widthScale, heightScale);
                float newWidth    = WorkshopSettings.Image.Width * scale;
                float newHeight   = WorkshopSettings.Image.Height * scale;

                document.AddImage(WorkshopSettings.RawImage, newWidth, newHeight, (startHorizontal + 5), startVertical + 5);
            }

            AbsolutePositionText(document, Resources.TXT_TACHOGRAPH_CALIBRATION_CERTIFICATE, (startHorizontal + 32), (startVertical + 0), 580, 100, document.GetXLargeFont(false), Element.ALIGN_CENTER);

            AbsolutePositionText(document, Resources.TXT_DATE, (startHorizontal + 355), (startVertical + 200), 200, 40);
            AbsolutePositionText(document, GetCalibrationTime(tachographDocument.CalibrationTime), (startHorizontal + 400), (startVertical + 200), 200, 40);

            DateTime?calibrationDate = tachographDocument.CalibrationTime;

            if (calibrationDate == null)
            {
                calibrationDate = DateTime.Today;
            }

            string expiryDate = Resources.TXT_EXPIRY + (GetCalibrationTime(calibrationDate.Value.AddYears(2).AddDays(-1)));

            if (tachographDocument.DocumentType != Resources.TXT_MINOR_WORK_DETAILS)
            {
                AbsolutePositionText(document, expiryDate, (startHorizontal + 355), (startVertical + 200), 580, 100);
            }

            AbsolutePositionText(document, Resources.TXT_ANALOGUE_INSPECTIONS, (startHorizontal + 320), (startVertical + 5), 200, 40);

            AbsolutePositionText(document, Resources.TXT_DIGITAL_INSPECTIONS, (startHorizontal + 320), (startVertical + 240), 200, 40);

            AbsolutePositionText(document, Resources.TXT_MAKE, (startHorizontal + 150), (startVertical + 20), 550, 72, document.GetRegularFont(true));

            AbsolutePositionText(document, Resources.TXT_TYPE, (startHorizontal + 347), (startVertical + 20), 550, 72, document.GetRegularFont(true));

            AbsolutePositionText(document, Resources.TXT_SERIAL_NUMBER, (startHorizontal + 347), (startVertical + 46), 550, 72, document.GetRegularFont(true));

            AbsolutePositionText(document, tachographDocument.TachographMake, (startHorizontal + 150), (startVertical + 32), 550, 72);

            AbsolutePositionText(document, tachographDocument.TachographModel, (startHorizontal + 347), (startVertical + 32), 550, 72);

            AbsolutePositionText(document, tachographDocument.SerialNumber, (startHorizontal + 347), (startVertical + 58), 550, 72);

            AbsolutePositionText(document, Resources.TXT_VEHICLE, (startHorizontal + 5), (startVertical + 104), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, Resources.TXT_VRN, (startHorizontal + 170), (startVertical + 510), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_VIN, (startHorizontal + 170), (startVertical + 520), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYRE_SIZE, (startHorizontal + 170), (startVertical + 530), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_W_FACTOR, (startHorizontal + 170), (startVertical + 540), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYRE_L_FACTOR, (startHorizontal + 170), (startVertical + 550), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_ODOMETER_READING, (startHorizontal + 170), (startVertical + 560), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_SET_K_FACTOR, (startHorizontal + 170), (startVertical + 72), 570, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, $"{tachographDocument.VehicleMake} {tachographDocument.VehicleModel}", (startHorizontal + 170), (startVertical + 500), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, tachographDocument.RegistrationNumber, (startHorizontal + 240), (startVertical + 510), 550, 72);
            AbsolutePositionText(document, tachographDocument.VIN, (startHorizontal + 240), (startVertical + 520), 550, 72);
            AbsolutePositionText(document, tachographDocument.TyreSize, (startHorizontal + 240), (startVertical + 530), 550, 72);
            AbsolutePositionText(document, string.Format(Resources.TXT_IMP_KM, tachographDocument.WFactor), (startHorizontal + 240), (startVertical + 540), 550, 72);
            AbsolutePositionText(document, string.Format(Resources.TXT_MM, tachographDocument.LFactor), (startHorizontal + 240), (startVertical + 550), 550, 72);
            AbsolutePositionText(document, tachographDocument.OdometerReading, (startHorizontal + 240), (startVertical + 560), 550, 72);
            AbsolutePositionText(document, tachographDocument.KFactor, (startHorizontal + 240), (startVertical + 570), 550, 72);

            AbsolutePositionText(document, Resources.TXT_AUTHORISED_TACHOGRAPH_CENTER, (startHorizontal + 30), (startVertical + 650), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, RegistrationData.CompanyName, (startHorizontal + 30), (startVertical + 670), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, WorkshopSettings.Address1, (startHorizontal + 30), (startVertical + 700), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, $"{WorkshopSettings.Town} {WorkshopSettings.PostCode}", (startHorizontal + 30), (startVertical + 730), 550, 72, document.GetLargerFont(false));

            AbsolutePositionText(document, string.Format(Resources.TXT_DISTRIBUTOR_SEAL, RegistrationData.SealNumber), (startHorizontal + 30), (startVertical + 760), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, Resources.TXT_AUTHORISED_TESTERS_SIGNATURE, (startHorizontal + 350), (startVertical + 246), 550, 72, document.GetLargerFont(false));

            TryAddSignature(document, tachographDocument, (startHorizontal + 350));
            AbsolutePositionText(document, string.Format(Resources.TXT_SIGNATURE_TECHNICIAN, tachographDocument.Technician), (startHorizontal + 350), (startVertical + 340), 550, 20);

            Image logoImage = Image.GetInstance(ImageHelper.CopyResourceToFileSystem("skillray_small"));

            logoImage.SetAbsolutePosition(50, 790);
        }
コード例 #11
0
 protected void GetSmallImage(PDFDocument document, PdfPTable table)
 {
     ImageHelper.SaveImageToDisk(GetWorkshopImage(), Path.Combine(ImageHelper.GetTemporaryDirectory(), "logo.png"));
     iTextSharp.text.Image itextSharpImage = document.GetImage(Path.Combine(ImageHelper.GetTemporaryDirectory(), "logo.png"), 205, 53);
     document.AddSpannedCell(table, itextSharpImage, 4, document.GetRegularFont(false), 40);
 }
コード例 #12
0
ファイル: StatusReport.cs プロジェクト: jpreecedev/WebCal
        private static void CreateTachoCentreQuarterlyCheckTable(PDFDocument document, StatusReportViewModel statusReport)
        {
            AddImageFromResource(document, "skillray_small", 61, 770);
            AddImageFromResource(document, "webcal_print_logo", 325, 770);

            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_CENTRE_QUARTERLY_CHECK, 61, document.Height - 80, 300, 35, document.GetRegularFont(true, true), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_DATE_OF_LAST_CHECK, 61, document.Height - 100, 261, 35, document.GetRegularFont(true), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_DATE_OF_NEXT_CHECK, 141, document.Height - 100, 341, 35, document.GetRegularFont(true), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_STATUS, 221, document.Height - 100, 421, 35, document.GetRegularFont(true), Element.ALIGN_LEFT);

            string statusText;
            var    color = GetStatus(statusReport.TachoCentreQuarterlyStatus, out statusText);

            if (statusReport.TachoCentreLastCheck != null)
            {
                var lastCheck = statusReport.TachoCentreLastCheck.GetValueOrDefault();
                var nextCheck = lastCheck.AddMonths(3).Date;
                AbsolutePositionText(document, lastCheck.ToString(Constants.ShortYearDateFormat), 61, document.Height - 120, 261, 35, document.GetRegularFont(false, color), Element.ALIGN_LEFT);
                AbsolutePositionText(document, nextCheck.ToString(Constants.ShortYearDateFormat), 141, document.Height - 120, 341, 35, document.GetRegularFont(false, color), Element.ALIGN_LEFT);
            }

            AbsolutePositionText(document, statusText, 661, document.Height - 120, 221, 35, document.GetRegularFont(false, color), Element.ALIGN_LEFT);
        }
コード例 #13
0
        protected override void CreateLargeLabel(PDFDocument document, TachographDocument tachographDocument, int startHorizontal, int startVertical)
        {
            AbsolutePositionText(document, Resources.TXT_TACHOGRAPH_RECORD_SHEET, (startHorizontal + 32), (startVertical + 0), 580, 100, document.GetXLargeFont(false), Element.ALIGN_CENTER);
            AbsolutePositionText(document, TrimDocumentType(tachographDocument.DocumentType), (startHorizontal + 32), (startVertical + 30), 580, 100, document.GetRegularFont(false));

            //Outlining
            DrawLargeLabelRectangle(document, startHorizontal, startVertical);
            document.DrawLine((startHorizontal + 50), (startVertical + 146), (startHorizontal + 545), (startVertical + 146), TotalPageHeight);
            document.DrawLine((startHorizontal + 50), (startVertical + 234), (startHorizontal + 545), (startVertical + 234), TotalPageHeight);
            document.DrawLine((startHorizontal + 150), (startVertical + 334), (startHorizontal + 298), (startVertical + 334), TotalPageHeight);
            document.DrawLine((startHorizontal + 347), (startVertical + 334), (startHorizontal + 494), (startVertical + 334), TotalPageHeight);

            AbsolutePositionText(document, Resources.TXT_TACHOGRAPH, (startHorizontal + 50), (startVertical + 93), 150, 100);
            AbsolutePositionText(document, Resources.TXT_VEHICLE, (startHorizontal + 50), (startVertical + 175), 150, 100);
            AbsolutePositionText(document, Resources.TXT_TECHNICIAN, (startHorizontal + 50), (startVertical + 270), 150, 20);
            AbsolutePositionText(document, Resources.TXT_DATE, (startHorizontal + 150), (startVertical + 328), 200, 40);

            TryAddSignature(document, tachographDocument, (startHorizontal + 330));
            AbsolutePositionText(document, string.Format(Resources.TXT_SIGNATURE_TECHNICIAN_LARGE, tachographDocument.Technician), (startHorizontal + 347), (startVertical + 328), 550, 40);

            //Tachograph
            AbsolutePositionText(document, Resources.TXT_MAKE, (startHorizontal + 150), (startVertical + 60), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYPE, (startHorizontal + 347), (startVertical + 60), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.TachographMake, (startHorizontal + 150), (startVertical + 72), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.TachographModel, (startHorizontal + 347), (startVertical + 72), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, Resources.TXT_ODOMETER_READING, (startHorizontal + 150), (startVertical + 86), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_SERIAL_NUMBER, (startHorizontal + 347), (startVertical + 86), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.OdometerReading, (startHorizontal + 150), (startVertical + 98), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.SerialNumber, (startHorizontal + 347), (startVertical + 98), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, Resources.TXT_SET_K_FACTOR, (startHorizontal + 150), (startVertical + 112), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.KFactor, (startHorizontal + 150), (startVertical + 124), 550, 72, document.GetRegularFont(false));

            if (tachographDocument.DocumentType == Resources.TXT_MINOR_WORK_DETAILS)
            {
                const int workDetailsHeight = 19;
                document.ContentByte.SetColorStroke(new BaseColor(Color.Black));
                document.ContentByte.Rectangle((startHorizontal + 20), (TotalPageHeight - (startVertical + 44 + workDetailsHeight)), 555, workDetailsHeight);
                document.ContentByte.Stroke();

                AbsolutePositionText(document, Resources.TXT_WORK_CARRIED_OUT, (startHorizontal + 50), (startVertical + 40), 150, 100, document.GetSmallerFont());
                AbsolutePositionText(document, tachographDocument.MinorWorkDetails, (startHorizontal + 150), (startVertical + 40), 450, 100, document.GetSmallerFont());
            }

            //Vehicle

            AbsolutePositionText(document, Resources.TXT_MAKE_AND_MODEL, (startHorizontal + 150), (startVertical + 144), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_VRN, (startHorizontal + 347), (startVertical + 144), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, string.Format("{0} {1}", tachographDocument.VehicleMake, tachographDocument.VehicleModel), (startHorizontal + 150), (startVertical + 156), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.RegistrationNumber, (startHorizontal + 347), (startVertical + 156), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, Resources.TXT_VIN, (startHorizontal + 150), (startVertical + 170), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYRE_SIZE, (startHorizontal + 347), (startVertical + 170), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, tachographDocument.VIN, (startHorizontal + 150), (startVertical + 182), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.TyreSize, (startHorizontal + 347), (startVertical + 182), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, Resources.TXT_W_FACTOR, (startHorizontal + 150), (startVertical + 196), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, Resources.TXT_TYRE_L_FACTOR, (startHorizontal + 347), (startVertical + 196), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, string.Format(Resources.TXT_IMP_KM_VEHICLE, tachographDocument.WFactor), (startHorizontal + 150), (startVertical + 208), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, tachographDocument.LFactor + Resources.TXT_MM, (startHorizontal + 347), (startVertical + 208), 550, 72, document.GetRegularFont(false));

            //Technician

            AbsolutePositionText(document, RegistrationData.CompanyName, (startHorizontal + 150), (startVertical + 234), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, WorkshopSettings.Address1, (startHorizontal + 150), (startVertical + 258), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, string.Format("{0} {1}", WorkshopSettings.Town, WorkshopSettings.PostCode), (startHorizontal + 150), (startVertical + 272), 550, 72, document.GetRegularFont(false));

            AbsolutePositionText(document, string.Format(Resources.TXT_MINIMAL_LICENSE_NUMBER, RegistrationData.SealNumber), (startHorizontal + 347), (startVertical + 234), 550, 72, document.GetRegularFont(false));
            AbsolutePositionText(document, GetCalibrationTime(tachographDocument.CalibrationTime), (startHorizontal + 150), (startVertical + 314), 250, 40, document.GetRegularFont(false));
        }
コード例 #14
0
ファイル: QC6MonthReport.cs プロジェクト: jpreecedev/WebCal
        public static void Create(PDFDocument document, QCReport6Month qcReport6Month)
        {
            AddImageFromResource(document, "skillray_small", 61, 770);
            AddImageFromResource(document, "webcal_print_logo", 200, 770);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_CENTRE_QC_CHECK, 400, 770, 560, 25, document.GetRegularFont(true, true), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_CENTRE_NAME, 61, 725, 480, 25, document.GetRegularFont(true), Element.ALIGN_LEFT);
            AbsolutePositionText(document, qcReport6Month.CentreName, 150, 725, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_CENTRE_SEAL_NUMBER, 61, 700, 480, 25, document.GetRegularFont(true), Element.ALIGN_LEFT);
            AbsolutePositionText(document, qcReport6Month.CentreSealNumber, 150, 700, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_DECLARATION, 61, 675, 480, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_SECTION_3, 61, 600, 480, 25, document.GetRegularFont(true, true), Element.ALIGN_LEFT);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_3_QUESTION_1, qcReport6Month.Section3Question1, 61, 575, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_3_QUESTION_2, qcReport6Month.Section3Question1, 61, 550, 480, 25);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_SECTION_4, 61, 525, 480, 25, document.GetRegularFont(true, true), Element.ALIGN_LEFT);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_4_QUESTION_1, qcReport6Month.Section4Question1, 61, 500, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_4_QUESTION_2, qcReport6Month.Section4Question2, 61, 475, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_4_QUESTION_3, qcReport6Month.Section4Question3, 61, 450, 480, 25);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_SECTION_5, 61, 425, 480, 25, document.GetRegularFont(true, true), Element.ALIGN_LEFT);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_5_QUESTION_1, qcReport6Month.Section5Question1, 61, 400, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_5_QUESTION_2, qcReport6Month.Section5Question1, 61, 375, 480, 25);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_SECTION_7, 61, 350, 480, 25, document.GetRegularFont(true, true), Element.ALIGN_LEFT);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_7_QUESTION_1, qcReport6Month.Section7Question1, 61, 325, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_7_QUESTION_2, qcReport6Month.Section7Question1, 61, 300, 480, 25);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_SECTION_9, 61, 275, 480, 25, document.GetRegularFont(true, true), Element.ALIGN_LEFT);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_9_10_QUESTION_1, qcReport6Month.CalibrationSection9And10Question1, 61, 250, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_9_10_QUESTION_2, qcReport6Month.CalibrationSection9And10Question2, 61, 225, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_9_10_QUESTION_3, qcReport6Month.CalibrationSection9And10Question3, 61, 200, 480, 25);

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_SECTION_10, 61, 175, 480, 25, document.GetRegularFont(true, true), Element.ALIGN_LEFT);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_10_QUESTION_1, qcReport6Month.DataManagementSection10Question1, 61, 150, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_10_QUESTION_2, qcReport6Month.DataManagementSection10Question2, 61, 125, 480, 25);
            AddAnswerSection(document, Resources.TXT_QC_6_MONTH_SECTION_10_QUESTION_3, qcReport6Month.DataManagementSection10Question3, 61, 100, 480, 25);

            document.AddPage();

            AbsolutePositionText(document, Resources.TXT_QC_6_MONTH_STATE_REASONS, 61, 767, 500, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            document.DrawBox(61, 525, 464, 200);
            AbsolutePositionText(document, qcReport6Month.FurtherDetails, 71, 615, 480, 730, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(61, 450, 225, 35);
            AbsolutePositionText(document, $"{Resources.TXT_QC_REPORT_CHECK_TECHNICIAN} {qcReport6Month.Name}", 65, 480, 255, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);

            document.DrawBox(61, 400, 225, 35);
            AbsolutePositionText(document, Resources.TXT_QC_REPORT_CHECK_SIGNATURE, 65, 430, 450, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
            TryAddSignature(document, qcReport6Month.Name, 100, 390);

            document.DrawBox(61, 350, 225, 35);
            AbsolutePositionText(document, Resources.DATE + DateTime.Now.ToString(Constants.ShortYearDateFormat), 65, 380, 255, 25, document.GetRegularFont(false), Element.ALIGN_LEFT);
        }
コード例 #15
0
        protected void AbsolutePositionText(PDFDocument document, string text, float left, float top, float width, float height)
        {
            ColumnText titleHeaderText = document.GetNewColumn(left, (TotalPageHeight - top), width, height);

            document.AddParagraph(text, titleHeaderText, document.GetRegularFont(false));
        }
コード例 #16
0
        protected override void CreateSmallLabel(PDFDocument document, TachographDocument tachographDocument)
        {
            var table = new PdfPTable(4);

            table.TotalWidth = 136;
            table.SetWidths(new float[] { 58, 10, 10, 58 });

            GetSmallImage(document, table);

            document.AddSpannedCell(table, Resources.TXT_TACHOGRAPH_AND_M1N1_INSPECTION_PLATE, 4, document.GetSmallerFont(), 29);

            document.AddSpannedCell(table, string.Format(Resources.TXT_W_FACTOR_IMP_KM, tachographDocument.WFactor), 2, document.GetXSmallFont(false), 15);
            document.AddSpannedCell(table, string.Format(Resources.TXT_K_FACTOR_IMP_KM, tachographDocument.KFactor), 2, document.GetXSmallFont(false), 15);

            document.AddSpannedCell(table, string.Format(Resources.TXT_L_FACTOR_MM, tachographDocument.LFactor), 1, document.GetXSmallFont(false), 15, 58);
            document.AddSpannedCell(table, string.Format(Resources.TXT_VIN_SMALL_LABEL, tachographDocument.VIN), 3, document.GetXXSmallFont(), 16, 68);

            document.AddSpannedCell(table, string.Format(Resources.TXT_TYRE_SIZE_SMALL_LABEL, tachographDocument.TyreSize), 4, document.GetSmallFont(false), 17, Element.ALIGN_LEFT);
            document.AddSpannedCell(table, string.Format(Resources.TXT_SERIAL_NUMBER_SMALL_LABEL, tachographDocument.SerialNumber), 4, document.GetSmallFont(false), 17, Element.ALIGN_LEFT);

            document.AddSpannedCell(table, string.Format(Resources.TXT_M1N1_SERIAL_SMALL_LABEL, tachographDocument.TachographAdapterSerialNumber), 4, document.GetSmallFont(false), 18, Element.ALIGN_LEFT);
            document.AddSpannedCell(table, string.Format(Resources.TXT_LOCATION_SMALL_LABEL, tachographDocument.TachographAdapterLocation), 4, document.GetSmallFont(false), 16, Element.ALIGN_LEFT);
            document.AddSpannedCell(table, string.Format(Resources.TXT_COLOR_SMALL_LABEL, tachographDocument.TachographCableColor), 4, document.GetSmallFont(false), 16, Element.ALIGN_LEFT);

            GetCompanyDetails(document, table, 69, 3, document.GetSmallerFont());

            document.AddSpannedCell(table, Resources.TXT_SMALL_LABEL_DATE + GetCalibrationTime(tachographDocument.CalibrationTime), 1, document.GetRegularFont(false));
            document.AddSpannedCell(table, GetLicenseNumberParagraph(document, false), 4, 16, Element.ALIGN_LEFT);

            table.WriteSelectedRows(0, -1, document.Document.LeftMargin + 2, document.Height - 103, document.ContentByte);
        }
コード例 #17
0
ファイル: StatusReport.cs プロジェクト: jpreecedev/WebCal
        private static void CreateMonthlyGV212Table(PDFDocument document, StatusReportViewModel statusReport)
        {
            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_MONTHLY_GV_212, 325, document.Height - 80, 425, 35, document.GetRegularFont(true, true), Element.ALIGN_LEFT);

            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_GENERATED_AND_PRINTED, 325, document.Height - 100, 425, 35, document.GetRegularFont(true), Element.ALIGN_LEFT);
            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_STATUS, 450, document.Height - 100, 550, 35, document.GetRegularFont(true), Element.ALIGN_LEFT);

            string statusText;
            var    color = GetStatus(statusReport.GV212Status, out statusText);

            AbsolutePositionText(document, statusReport.GV212LastCheck == null ? string.Empty : statusReport.GV212LastCheck.Value.ToString(Constants.ShortYearDateFormat), 325, document.Height - 120, 500, 35, document.GetRegularFont(false, color), Element.ALIGN_LEFT);
            AbsolutePositionText(document, statusText, 450, document.Height - 120, 625, 35, document.GetRegularFont(false, color), Element.ALIGN_LEFT);
        }
コード例 #18
0
ファイル: StatusReport.cs プロジェクト: jpreecedev/WebCal
        private static void CreateTechniciansQuarterlyTable(PDFDocument document, IEnumerable <Technician> technicians)
        {
            AbsolutePositionText(document, Resources.TXT_STATUS_REPORT_TECHNICIANS_QU_REPORT, 61, document.Height - 160, 300, 35, document.GetRegularFont(true, true), Element.ALIGN_LEFT);

            var table = new PdfPTable(4);

            table.SetWidths(new float[] { 289, 289, 289, 289 });

            AddCell(document, table, Resources.TXT_STATUS_REPORT_TECHNICIAN_NAME, BaseColor.BLACK, true);
            AddCell(document, table, Resources.TXT_STATUS_REPORT_DATE_OF_NEXT_CHECK, BaseColor.BLACK, true);
            AddCell(document, table, Resources.TXT_TRAINING_DATE, BaseColor.BLACK, true);
            AddCell(document, table, Resources.TXT_STATUS_REPORT_STATUS, BaseColor.BLACK, true);

            foreach (var technician in technicians)
            {
                string statusText;
                var    color = GetStatus(technician.HalfYearStatus(), out statusText);

                string threeYearStatusText;
                var    threeYearColor = GetStatus(technician.ThreeYearStatus(), out threeYearStatusText);

                AddCell(document, table, technician.Name, color, false);
                AddCell(document, table, technician.DateOfLastCheck == null ? string.Empty : technician.DateOfLastCheck.Value.ToString(Constants.ShortYearDateFormat), color, false);
                AddCell(document, table, technician.DateOfLast3YearCheck == null ? string.Empty : technician.DateOfLast3YearCheck.Value.ToString(Constants.ShortYearDateFormat), threeYearColor, false);

                BaseColor statusTextColor;
                AddCell(document, table, GetStatusText(statusText, threeYearStatusText, out statusTextColor), statusTextColor, false);
            }

            table.TotalWidth = 520;
            table.WriteSelectedRows(0, -1, document.Document.LeftMargin + 10, document.Height - 190, document.ContentByte);
        }