Example #1
0
        private Doc AddFooter(Doc theDoc, string id, int lineNumber)
        {
            var theCount = theDoc.PageCount;

            var deliveryAssurance = _deliveryNoteRepository.GetDeliveryAssurance(id, lineNumber);

            for (var i = 1; i <= theCount; i++)
            {
                theDoc.FontSize = 8;

                theDoc.Rect.String  = "45 30 575 110";
                theDoc.Color.String = "0 0 0";

                theDoc.Font = theDoc.AddFont("Arial");

                theDoc.AddText($"Leveransförsäkran skapad av {GetCustomerName(deliveryAssurance.SupplierNumber)}");

                theDoc.AddLine(45, 100, 575, 100);

                if (DeliveryAssurancePage != null)
                {
                    AddTextInRect("45 30 151 85", FixNewLine(DeliveryAssurancePage.Footer1), ref theDoc);
                    AddTextInRect("151 30 257 85", FixNewLine(DeliveryAssurancePage.Footer2), ref theDoc);
                    AddTextInRect("257 30 363 85", FixNewLine(DeliveryAssurancePage.Footer3), ref theDoc);
                    AddTextInRect("363 30 469 85", FixNewLine(DeliveryAssurancePage.Footer4), ref theDoc);
                    AddTextInRect("469 30 575 85", FixNewLine(DeliveryAssurancePage.Footer5), ref theDoc);
                }
            }
            return(theDoc);
        }