givp
givp

Reputation: 2494

UIWebView and PDF Files Lags for Scroll and Zoom

I am loading a relatively small PDF file (140kb) using UIWebView and even though this is working fine, I'm finding it lags a lot when I scroll and zoom. The PDF is a map so there's quite a lot of text and lines on it so I'm wondering if there's any way to accelerate it somehow so everything moves smoother? Would converting to PNG work better? It is smoother but the 140kb PDF become 1.2mb after the conversion so I don't know if that's a good solution.

Any advice would be appreciated.

Thanks

Upvotes: 0

Views: 6353

Answers (2)

Brad Larson
Brad Larson

Reputation: 170319

You may be able to coax more performance out of the device by using a CATiledLayer to render your PDF map. Bill Dudney has some sample code that does just this, although on the Mac. His iPhone version of the same code doesn't work with a map, but it would be trivial to transplant the routines in there to do that.

Upvotes: 3

Marco
Marco

Reputation: 15027

If you email the PDF in question to yourself, then view it as the attachment in Mail, is the performance similar?

If so, it's probably just limitations of the rendering speed of the CPU. Once you toss a lot of graphical complexity at it, the iPhone slows down dramatically.

Upvotes: 7

Related Questions