PDF download issue

35 views
Skip to first unread message

jasmeet singh

unread,
May 3, 2013, 3:07:53 AM5/3/13
to leaves-d...@googlegroups.com
How to load  only single page of pdf at  a time  so that user can read large pdf files quickly ,otherwise it gives a hang like experience while downloading large pdf files?

overlordhammer

unread,
May 4, 2013, 8:08:34 AM5/4/13
to leaves-d...@googlegroups.com
Jasmeet

Pdf file size doesn't matter, the application only loads a single page a time, the file size shouldn't be a problem. You can experience memory issues with other parts of the code however since it's quite old and is not longer mantained. I strongly suggest you to move to better pdf reader implementations using ARC.

ronjoh...@gmail.com

unread,
May 4, 2013, 9:15:03 AM5/4/13
to leaves-d...@googlegroups.com
is there an updated pdf reader out thee?
--
You received this message because you are subscribed to the Google Groups "Leaves Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaves-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jasmeet singh

unread,
May 10, 2013, 7:44:50 AM5/10/13
to leaves-d...@googlegroups.com

Rodrigo It actually loads the  entire pdf , then only user is able to see the pdf, but I want the user to be able to open pdf if only first few pages are downloaded or something like lazy loading is possible as in the case of tableview in which as you know we are able to show the visible the part while the other part is being loaded .
Any efforts regarding this will be highly appreciated.

and do you know how to get this gradient out of the pdf files when I turn to the next page

Rodrigo Hammerly

unread,
May 11, 2013, 11:15:10 PM5/11/13
to leaves-d...@googlegroups.com
Jassmet,

 I'm pretty sure it doesn't load the whole PDF. Single PDF pages are drawn at PDFExampleViewController.m renderPageAtIndex:inContext: using CGContextDrawPDFPage function, this function uses a page reference (CGPDFPageRef)retrieved from the PDF file reference (CGPDFDocumentRef) only at drawing time, as you can see the only thing that is kept by the application all time is the file reference, not the whole file content, and it only accesses a single page information at a time when draw operation is requested. Application catches drawn pages in a cache however, but cache has a size limit to avoid memory overload. 
Application has many other memory leaks however but are not related to the PDF file size as far as I can remember. Also its weakest point is related to the fact that all drawing is made at main thread rendering UI unresponsive sometimes, I made myself a fork of brow's code to add double page support you can see it here, it has some other minor fixes related to memory management. However as I said before I strongly recommend you to move forward and look for newer implementations with ARC support and a better approach since this version is really old and has many memory related issues.

Rodrigo
Reply all
Reply to author
Forward
0 new messages