PDF viewing/annotating library for iPhone?
Asked Answered
P

3

9

I am currently working on an educational project where I would like to add some PDF reading functionality to an iPhone app. I know that it is possible to add a UIWebView and display the PDF there, however I would like to add the ability to show page number, 'next', 'previous' buttons etc. Is CGPDFDocument the direction that I should be headed or is there a better (ie more feature rich) library available? I have had a look around to try and find the capabilities of CGPDFDocument, but besides the API reference there is not much available.

Would it also be possible with this to annotate a pdf?

Thanks

JP

Piroshki answered 29/1, 2010 at 10:28 Comment(2)
can please answer for this link i hope you can ..#4322181Snatchy
@Piroshki have you found some solution how to select text and make annotation?Glyoxaline
T
5

Here is a good (working) example of the CGPDF functions: http://www.olivetoast.com/blog/2009/08/simple-uiscrollview-catiledlayer-pdf-example/

It uses a CATiledLayer + UIScrollView, this may not be appropriate for a reader of sorts, but it still shows you how to load and draw a PDF doc without UIWebView (which severely restricts your abilities).

Change the layer type back to a layer, add in page handling using CGPDFDocumentGetNumberOfPages and then CGPDFDocumentGetPage and you have a pretty good reader.

I don't know how to perform annotations, I suspect you would need your own data structure on top of the document.

Transcendental answered 8/2, 2010 at 10:9 Comment(2)
Yeah I had a look at this earlier today, it is really useful for drawing PDFs, thanks. My next problem is handling annotations - have no idea where to start.Piroshki
this project is so, so cool :D I can recommend for others. :)Barmy
B
1

Update: 04 Feb 2012

Check out this project, it's opensource and very well made. I think it could be a great starting point for your PDF reader.

Project:
http://www.vfr.org/

Source:
https://github.com/vfr/Reader

Bb answered 4/2, 2012 at 19:7 Comment(0)
K
0

There are PDF reader apps, do these not support annotations?

Another angle could be for the iPhone app to read/download pages (images) from the internet, where one could add basic annotations to that (image/layer based), these coordinates could be saved to a server. Those annotations could then be added programatically to a PDF on the server for download?

Koski answered 29/1, 2010 at 10:33 Comment(1)
Thanks for the reply. I don't know if there are any apps available that do support annotations. However, having looked there is an app here bit.ly/3JiFiv that does support it. I was wondering if there was a built in library or similar that supported these features.Piroshki

© 2022 - 2024 — McMap. All rights reserved.