Discussion Forums  >  Uncategorized

Replies: 8    Views: 346

Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
02/01/12 10:18 PM (8 years ago)

PDF file load time (local, not downloaded) iOS

I've got several PDFs in my latest app that are all around 440kb in size. I have them loaded in xCode to be included in the build, and in the xCode simulator, I get the pinwheel for about 1.5 seconds (not bad). This is regardless of if I've click on it before (not caching?). I can click on a PDF, go back and click it again, and it still has the delay.

The real problem is when I load it on a real device. The pinwheel (load time) is a LOT longer.

Is this normal behavior? is 440kb that big of a task for the iphone to load? or is it inherent to PDFs?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/02/12 02:06 AM (8 years ago)
Kinda both things. UIWebViews in iOS are notoriously slow when loading largish files. The trouble with PDF (and any other binary data) is that the UIWebView does not load it progressively like it can and does with HTML. This means it must load it all into memory, then display it.

I don't know of any work-arounds for this short of creating a cool custom view to show a little dancing monkey on top of the pdf while it's loading. This cold be entertaining enough to help you forget about the slow load. So laughing.

Or, of course you could cut up the document into smaller parts and use a menu system. I don't like this idea but you could do it.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/02/12 04:26 AM (8 years ago)
Its actually just a single page 8.5x11 document. I wanted to keep it in PDF form vs. html so the user could use the email button to send the PDF as-is to someone. Maybe I need to look into compression for the PDFs. They only have a header and a table on plain white background. Maybe its the way I am exporting them. (I used Photoshop's PDF export function - using the 'economy' setting)
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/02/12 08:11 AM (8 years ago)
Convert the pdf to HTML
Use the email to send pdf
User doesn't need to know it's two different docs.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/02/12 08:13 AM (8 years ago)
The email button in the bottom toolbar of buzztouch will use the viewed document as the attachment. I don't think you can use the built-in function at buzztouch to show one page, and email a different one.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/02/12 09:00 AM (8 years ago)
''Email button on bottom toolbar'' perhaps that's an iOS thing. Please explain if possible.

I create a Right Nav Bar button and link to a share screen and place link to pdf file. User sees HTML doc (BT Android PDF screen doesn't work) but emails link to pdf.
Fred

Fed
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/02/12 10:45 AM (8 years ago)
Under ''Document Behavior'' there's a toggle for ''Show Email Document Link''. It sends the current page (whether a picture, html page, PDF, etc) and attaches it to a new email.

But I like the text link in a share screen idea. I may not go back on my current app and change all the pages, but I'll keep that trick in my back pocket.

Thanks!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/02/12 10:53 AM (8 years ago)
Hey thanks for the info, can't believe I hadn't seen that.
Fred
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 804
Reg: Feb 20, 2011
Rockwall, TX
17,340
like
02/03/12 08:58 PM (8 years ago)
Using Acrobat Pro: open the PDF. Go to Document > Reduce file size. If ya don't have pro, send it to me. I do. I'll shrink it and send it back. My apps are mostly PDF and I now do this to every page, HUGE difference in size, usually.

tim.w@apps4ems.com
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.