How to Searching String from PDF using iphone sdk? - iphone

I am trying to create a PDF Reader application allow user to search string from the PDF. The very simple idea for displaying the PDF in webView but I don't know whether I can perform search in the PDF displayed in UIWebView or not?
If this is possible then please provide me any good tutorial for this. If not then I am using CGPDFDocumentRef and other classes of CoreGraphics. I am done with displaying PDF on a UIView without having UIWebView. I am unable to Zoom yet but it is displaying. Now for searching I have used this tutorial. http://www.random-ideas.net/posts/42. I am able to search and getting a bool value for string is available or not. but I am not getting how to highlight search text in PDF.
Please help me if it is possible with any one, UIWebView or the way I am doing using CoreGraphics.
Thanks.

Related

Is there a way to use PDFKit to only display selected part of a pdf?

I am trying to create a program that displays pdfs in chunks. So if you have a 100 page pdf and you only want to display the first chapter you could code something for only showing pages 1 - 10. I've searched around and as it stands it seems this is the best way to display pdfs. The problem is this loads the entire pdf at once in a reader. Going through the documentation now and I can't find anyway to selectively display the pdf. is there a way to selectively display pdf text using pdfkit? or will I have to use some other library for that?
I also see there's a tabViewStyle(.page) I can use to get a paged reader view in swiftui but I'd prefer not to have to format and prettify the text if possible.
I'm not opposed to using 3rd party libraries I just don't want to have to deal with formatting text or whatever. thanks!

Highlighting a string in a pdf iphone

I'm developing a book app.My client has provided all the contents of pdf.
I have already implemented all the contents of pdf to book.
But he wanted to highlight a text in that pdf.
The user would like the text to allow for highlighting (like if you're reading a paper book).
Is this possible? Can anyone help me on this, please?
Thanks in advance.
Theoretically yes.. depends on a bit hacking and other things, for example fonts used in the PDF. Have a look at PdfKitten, their demo project can find text in a PDF and highlight it. That should give you a first pointer on how to highlight. If you want to the user to highlight with the touches you would need to be able to transform locations of touches into the PDF to determine where exactly the user touched, but it should be possible.

Search for a word in a PDF on iPad

I use CGPDFDocumentRef control to view pdf file in iPad. I want to add search capability and highlight the results. Any suggestions on how I can do so? In addition, I would like to know if there there a way to zoom in and out using a multi-touch?
following sample has most of the features you need.
https://github.com/mobfarm/FastPdfKit

How to display a PDF (w/hyperlinks) in an iPhone app like GoodReader?

All I need to know is how to put a PDF page into a UIWebView, and then retrieve the URL value (into an NSString) of a link when clicked. Can somebody please offer their knowledge on this? Thanks in advance.
Most iPhone PDF viewers are using CGPDF to render the PDF content.
To implement features like hyperlinks (AFIK hyperlinks in PDF are done via a "link annotation" tag, but there may be some other way), the PDF viewer uses the CGPDF API to scan/parse the PDF content stream for a given page, pull out any data it is interested in, then implement support for that feature.
So for hyperlinks, a viewer may use CGPDF to render the page in a view. It would also use CGPDF to scan the page looking for link annotations, and pull out any attributes it needed (contents, destination, coordinates, etc.) It would implement a touch-handler for the view and any code to execute when a user tapped the hyperlink.
This is not possible if you render PDFs in UIWebView.

PDF to HTML in iPhone

Is it possible to convert a PDF page in to HTML format using any objective-c library. I want to enable the text selection on PDF files.
#swiecki approach is not valid for pdfs
My suggestion is to use CoreText and add an overlay over the pdf view.
But it will be a long and tedious process as you need to parse the pdf to find coordinates of every letter.