Searching text in PDF without embedded fonts in iOS - ios

I am using FastPdfKit and PDFKitten to search texts in a PDF in iOS. Searching works fine for PDFs with embedded fonts. If the font is not embedded, both libraries fail to give the correct location of the searched text.
If I open the PDFs in Preview (Mac) and use Duplicate function of Preview. The generated PDFs will have embedded fonts and will work correctly when searched using FastPdfKit and PDFKitten.
Should I programmatically recreate the PDF with the font embedded? But not sure on how to actually do this.
Or are there other workarounds for FastPdfKit or PDFKitten for this?
Thanks in advance for any help!

Related

Pdf text reflow in swift

I am currently using UIDocumentInteractionController to view pdf files. I know I can use UIWebView also.
My question is,
Is it possible to do text reflow for pdf files in swift where I can change font size and make it easier to read ? Is there any open source library for that?
I am saying something like this
Does apple PDFKit able to do it? Has any one tried it before?
Thanks!

Incorrect rendering of Urdu content

I'm attempting to render content both in a UILabel as well as in a WKWebView containing Urdu text. For display Noto Nastalique is used. However, it seems iOS has issues computing the correct spacing/ligature.
Using text from http://behdad.org/urdu/ as a test subject UILabel renders
while WKWebView renders (notice the glyphs overlapping)
In this small example the problems are most obvious in WebKit, but there are similar issues when wrapping text in UILabel. I'm hoping someone has faced and solved similar issues, or could point to information on best-practices for displaying Urdu content.
Example project can be found on github
I believe it is a problem with "Google Noto Nastaleeq" font on iPhone. Apple did try to implement in iOS 9. They had the similar problem.
Have you try to implement Jamil Noori Nastaleeq? Read my guide there I noticed Jamil Noori Nastleeq typeface don't have that kind of rendering issue.
For a reference please read my article that how I was able to make it so. https://medium.com/#mmudassir/nastleeq-and-ios-8-love-story-bit-broken-7cc2311fc784?source=linkShare-563fcf255dda-1461862616

Displaying ppt interactively on iOS device

I have browsed and searched a lot for this but couldn't find any relevant answers/posts. I am looking for a framework/library with the help of which I can convert ppt slides into images and then render them on iOS device. Any other way/procedure which will display ppt page-wise with giving control on page transition will also be great.
Thanks in advance
If you just want to view the Office files, have a look at:
Document Interaction Programming Topics for iOS: Quick Look Framework.
Quick Look Framework Reference
Quick Look Framework supports a lot of file formats as you can see in the links above. It is available in iOS 4.0 and later.
You can also use UIWebView to display them. See Using UIWebView to display select document types.

Add an annotation on a pdf

I have to develop a iPad app which can view a PDF file and draw some predefined annotations on it dynamically. It's like http://plangrid.com/ do.
I went though WWDC videos, stackoverflow and some other blogs.
But could not find a way to add a controller bar on the PDF. And drag a annotation from it and drop on the PDF.
I have an idea about to view a PDF. I followed ZoomingPDFViewer example.
Please advise me.
I'm using XCode 4 and iOS 4.3.
I'm not sure if you found the following stackoverflow post:
Annotate PDF within iPhone SDK
The first answer shows how to add text to a pdf page at a given location. This should be helpful for your purposes.

iOS cannot select/highlight text in PDF

I cannot select/highlight text in my PDF reader (when you press and hold text). I used the following to open/read PDF documents
http://developer.apple.com/library/ios/#samplecode/ZoomingPDFViewer/Listings/Classes_PDFScrollView_m.html#//apple_ref/doc/uid/DTS40010281-Classes_PDFScrollView_m-DontLinkElementID_4
Actually, with iOS5, Apple added support for text selection in UIWebView.
Unfortunately, there's no API for this, and their support is rather clunky and slow. And embedding UIWebView's into your app is a rather ugly solution. (and you can hardly control the UI)
You might wanna check out 3rd party iOS frameworks for that feature. https://stackoverflow.com/questions/3801358/pdf-parsing-library-for-ios
I worked the better part of year to roll my own PDF parser that calculates the glyphs to get text selection. (it's commercial, google for PSPDFKit)

Resources