3

I am currently using QLPreviewController to view PDFs (250MB+) However it cannot deal with real large files. Either I get the info that not the whole file has been loaded or the whole app just dies. I also need to customize the view which is nit possible using QLPreviewController. What should I do? Use UIWebView instead? Or will I have to use CGContextDrawPDFPage? Using the latter, how will I get zooming implemented?

Krumelur
  • 32,180
  • 27
  • 124
  • 263
  • I agree with FreeAsInBeer's answer, but is dividing these pdfs into smaller ones out of the question? A pdf file that large is too large anyway... – Dimitris Tavlikos Feb 27 '11 at 17:07
  • See my comment below. If my customers decide to view huge PDFs, I can't force them to split them up. I just want my app to handle it and not to crash. – Krumelur Feb 27 '11 at 20:59

1 Answers1

0

I would go with your suggestion of using a UIWebView. Doing so will automatically give you zoom support and the UIWebView should handle loading extremely large PDF's.


If you have decided to go with Quartz, this link looks very promising for zoom support.

FreeAsInBeer
  • 12,937
  • 5
  • 50
  • 82
  • I tested a bit. My test PDF has 630 pages. It is 230MB in size. In instruments I see that using UIWebView or UIDocumentIteractionController, memory usage goes up to 260MB an VM to 530MB. This works on iPhone4 but will kill iPad with its 256MB of RAM. The main difference I see is that UIWebView is very, very slow. Scrolling is almost impossible where it is speedy using UIDocumentInteractionController. Still, neither one seems to read page by page. I will try and see how hard a Quart implementation is. – Krumelur Feb 27 '11 at 20:59
  • Now tried using Quartz. Opening the document and viewing page 1 eats 10MB of RAM. But one has to implement all the zooming, scrolling etc. Wonder if there's existing code around. – Krumelur Feb 27 '11 at 21:16
  • Thanks for pointing me to the sample page! I took the code and MonoTouched it. See my other question here, which also contains a link to the code on my blog: http://stackoverflow.com/questions/5140079/catiledlayer-render-zoomable-pdf-page-what-are-levelsofdetail-and-levelsofd – Krumelur Feb 28 '11 at 13:38