Question

Hello i'm currently using QLPreviewController to view a pdf for a magazine app, but i want to have horizontal scrolling, i have got PSPDFKIT (think it's called that) and FastPDF to work fine but i don't have the money to pay for the liencese and don't wish to leave the water mark. is there any way to get QLPreviewController to view horizontally or even UIDocumentInteractionController to view horizontally.

Was it helpful?

Solution

Have you checked out this UIImage category? https://github.com/mindbrix/UIImage-PDF

You could use that to create a UIImage and add that to a UIScrollView. If you have separate PDF files for each page, you can create a UIImage for each one and create a horizontal scroll.

If you need to deal with multipage PDFs, then look at the file PDFView.m lines 43 & 83 - here it is assuming you always want page 1, it should be relatively trivial to add a property for the page number you wish to render instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top