Making rendering as fast as possible on old phones

58 views
Skip to first unread message

James

unread,
Jun 22, 2015, 3:34:59 PM6/22/15
to pdfne...@googlegroups.com

Q: Some users report sluggish performance on iPhone 4 (as expected). Do you also encounter this in iPhone 4?  Any tips to tweak performance for these older phones 


-------------------------------------------------


A:


Make sure disk caching is on:

[PTPDFNet SetDefaultDiskCachingEnabled:YES];

Turn off colour management, which may display some PDFs with inaccurate colours.

[PTPDFNet SetColorManagement:e_ptno_cms];

Turn off image smoothing. This will render images more quickly (due to faster resampling), but they may not look as good:

[self.pdfViewCtrl SetImageSmoothing:NO];

If you are able to modify PDFs before the user sees them (for instance if you were storing all the relevant PDFs on a server), you could pre-generate thumbnails (including high resolution ones) and embed them into the PDF, which will be rendered very quickly. If this is not possible you could consider turning off on-the-fly thumbnail generation. The on-the-fly thumbnails are used to give a low resolution representation of the page if the high resolution content has not yet been rendered:

[pdfViewCtrl SetupThumbnails:NO generate_at_runtime:NO use_disk_cache:NO thumb_max_side_length:0 max_abs_cache_size:500*1024*1024 max_perc_cache_size:0.8];


You can play with an optimal setting for progressive rendering, which is the update that occurs when content has been partially rendered. Every update gives the user feedback as the document is rendered, but slows down rendering a small amount.

[pdfViewCtrl SetProgressiveRendering:YES withInitialDelay:0 withInterval:750];


A final thing that can be done (although I wouldn't recommend it) would be to render the PDF at non-retina resolution:

pdfViewCtrl.retinaEnabled = NO;


Reply all
Reply to author
Forward
0 new messages