I’m trying to figure out the best way to generate multipage pdf reports with headers and footers from data that I have in my app.
Since I’m a graphically oriented person I wonder if there is a way to do the pdf layout in storyboard or as xib-files? If not what is the best way to do it in code?
Right now I use a hack that I made with PDFKit in iOS11 where I just draw PDFAnnotation text on an empty pdf. But this can’t obviously not be the right solution since I cannot handle wrapping of long texts nor page brakes.
So please can anyone tell me what the best practices are when it comes to print a PDF file from data within an iOS application?
I actually bought that book just because of this problem. It explains well how to show PDF:s with PDFKit in your app but unfortunately it doesn’t tell you anything about how to print (with print I mean generate pdf from app data) them thou…
Edit: just saw your other comment. Sorry it wasn’t totally clear, but you are somewhat generating PDF content in the sample. You can actually generate a PDFPage and PDFDocument with annotations and then save that data, thus generating a brand new PDF. It does require you to handle what your document should look like in code.