I'm loading a 50 pages 1.2 MByte PDF from the internet and saving it to the device. Then I'm loading the PDF from the device and show it inside a UIWebview.
It is lagging. When I scroll down more than 1.5 pages the page indicator (4 of 50) doesn't fade away as it should, the scroll motion stops, so no slowing down and it stays blurry. This all for about 3-6 seconds. And then it suddenly loads and everything's fine.
Same is for zooming. If I zoom, it just makes the same problems and after 5 seconds or so, it becomes clear and I can use it.
The PDF isn't large, so why is it lagging? It is only on the device, the simulator rocks perfectly.
Any suggestions? Is a Quartz PDF viewer faster? I have heard problems with the Quartz version concerning zoom...
How can I show this PDF without lag? Please help me!
Edit: I looked over it, but it seems to just load a PDF, but nothing special, it will still lag. This error appears also within Mobile Safari. There, the PDF also need about 6 seconds to load a particular page.
If the PDF lags in Mobile Safari, you are going to have a hard time doing any better than Apple's coders. Can you open the PDF on your MAC in Preview, and save it with the "Reduce File Size" filter? It might clean it up enough to stop the lagging.
Yes it laggs also in Mobile Safari and I tried the filter but the size just increased. But I really think the Hardware is too weak...Strange though, it's 1.2MByte!! That's sooo little...I don't get it. How can I manipulate the PDF? If I use a PDF with less pages, it works a little bit better...that means it's the content that's making problems...what could it be? Pictures? Diagramms? And why is this so? I mean it's not 50MB, its 1.2MB... really strange.
I wish I could help more. If the Reduce File Size filter made the file bigger, there's something messed up about that PDF. I doubt the size is the issue, and plenty of PDF's with pictures and diagrams work fine. I would suspect there's something wrong with the program that made the PDF. IF I were in your shoes, I would try to re-create it another way. You might also try PDFShrink.
Concerning the question. I heard yes, Quartz is faster, but Quartz has some problems:
- It kinda only loads PDFs from the MainBundle, but I need PDFs in the documents directory.
- It doesn't bounce like a Webview
- It doesn't reload after scroll, so it stays blurry