Alua-Kinzhebayeva / iOS-PDF-Reader

PDF Reader for iOS written in Swift
MIT License
533 stars 150 forks source link

Slow thumbnail generation on large documents #28

Closed rv-17 closed 7 years ago

rv-17 commented 7 years ago

Hi,

Large documents (500+ pages) exhibit a significant delay if opened which is apparently caused by the thumb bar.

Any ideas how to improve this?

ranunez commented 7 years ago

Hmm, interesting I don't think many of us have tested this on that large of a PDF! A good solution would be to lazy load the thumbnail images in the background instead of having to wait to load all of them to display the PDF. Thanks for the catch!

rsomlette commented 7 years ago

Same issue here. Loading a regular size magazine, (~120 pages) takes almost 7seconds.

ranunez commented 7 years ago

@romanvolkov-io @Niphery Performance should be dramatically better in 2.1.6, please let me know if this fixes it!

rsomlette commented 7 years ago

@ranunez It's way better yes thank you for the reactivity 👍 However the thumbnail preview take some times to load the first time I open the PDF. (8 sec) Not really an issue at the moment but I though i would let you know.

rv-17 commented 7 years ago

Thanks!

Yeah, I've already implemented something like that in a customer project recently. I also store generated thumbnails for caching purposes and regenerate them on demand.

Another todo: Recognize rotation preference (90, 180, 270 degrees) per page. See: https://developer.apple.com/reference/coregraphics/cgpdfpage/1455550-rotationangle