views:

486

answers:

2

I'm having a huge headache trying to figure this out. I'm trying to display a single page from a pdf file (the only one that is). This pdf page is a map that I need to zoom in and out with pinching, etc... I am doing this with CATileLayers (each tile being 256x256, but can set it to a bigger size). It does the job but REALLY slowly. What I wanted to do was to load all these tiles at once. Is that possible? drawInContext: is called for each tile, but when I move around but I have to wait for them to appear, and I wanted a smooth experience on the device. I haven't really got to the zooming part, but I'm afraid it will require more work than I expect. Other than that is there any way I can set the bounds of the superlayer to stop when it reaches the bounds of it or I have to do that manually on touchesMoved? Anyone ever had to deal with this situation?

I am trying to adapt the code from Bill Dudley found here: http://bill.dudney.net/roller/objc/entry/catiledlayer_example , but not having so much luck.

Any help and suggestions would be greatly appreciated. Thanks

+1  A: 

Did you try UIWebView? It can display PDF content, as well as some office doctypes.

Nikolai Ruhe
Unfortunately I can't use a UIWebView, it is too slow for the document I am drawing. Thanks
I had the same problem with UIWebView.
Nikolai Ruhe
A: 

"It does the job but REALLY slowly"

"I can't use a UIWebView, it is too slow"

It sounds like what you want is for the iPhone/iPod to have a more powerful CPU/GPU. Other than setting your tileSize to 1024x1024, there's really not much more you can do.

hatfinch
Thanks for your response hatfinch. I gave up on the PDF and managed to get it working using a different approach: turning the pdf into a tiled image and using ScrollViewSuite example from apple. Thanks a bunch.