0

I am able to add the footer in a pdf, using TPPDF library in iOS. But I am not able to keep the footer on every page of the PDF. Any solution for the same?

Here is how I have used the footer:

**let attributedString = NSAttributedString(string: "Page 1 of 1", attributes: regularTextAttributes)

document?.add(.footerLeft, attributedText: attributedString)**

Shivani Bajaj
  • 996
  • 10
  • 23

1 Answers1

0

Are you using a single PDFDocument instance, or you have different ones for every page you have in the final generate document? From what I've seen when you add a footer it's the same for the whole document (PDFDocument instance) and than you generate the final document via the PDFGenerator, but if you are using an array of documents (many PDFDocuments) and generate the final document via PDFMultiDocumentGenerator, then you'll need to add your footer to every single PDFDocument

note: if you are using the PDFMultiDocumentGenerator you might have issues with the default pagination of the document, and will need to manually handle the pagination's "page" and "total" with the customClosure PDFPaginationStyle

Tyler2P
  • 2,324
  • 26
  • 22
  • 31