Highlighting Text in pdf using iphone SDK? - iphone

I had asked a question earlier How to Searching String from PDF using iphone sdk?
I got a answer but that wasn't I was looking for. I am not sure to ask something similar as new question or not.
I am using ios4.2.
I am working on a application which display PDF. I am using Quartz 2D for that. I have gone through apple documentation and googleing of around 4 days I didn't find any thing that suits to me in this case. There are lots of question related to this and almost all answers are redirecting to either
Random Ideas or
FastKit.
Random Ideas don't explain how to highlight a text within the pdf. and FastKit has implementation but no Explaination too. I don't want to use fastkit because It shows its logo. can any one please give me any link which has some libraries or apis or any thing for highlighting text in PDF while I am using Quartz 2D.
Any help will be appreciated.
Thanks In Advance.

Related

Render openCTM files on android (especially flutter)

I'm currently developing an App in Flutter which i need to display 3D models. I know. Flutter is, at least at the moment, not the best choice (or shouldn't be even a choice) to build 3d apps but unfortunately i didn't know this when i started developing. I managed to render a simple '.obj' file with a simple engine I found on the internet:
https://levelup.gitconnected.com/a-simple-3d-engine-in-flutter-cc4a7edc943e
Now my problem:
My app needs to contain multiple hundred 3D models so I need to reduce the app's size. I experimented with openCTM to compress my '.obj' models and got a good result.
Now i want to display these '.ctm' files in my app. And thats the point where I got stuck.
I've researched for days if there's a sample or a tutorial to solve my problem but I haven't found one.
I've read the official openCTM documents and found openCtm reader ported to javascript (https://github.com/jcmellado/js-openctm) and dart (https://github.com/nelsonsilva/dart-openctm). And now I dont know where to begin.
I guess I need to, if my problem is solvable in flutter, modify the engine im currently using and add the openCTM reading part to it.
I hope that anyone of you can help me with my problem. Maybe even solved it already. Furthermore I hope I explained my problem clear enough.
If you can provide a native solution it would helpful, too.
Thank you in advance!

Image Editing Issue

I am working on an app with have requirement to give "Droste Effects" on image.i did search on Google more but not find programming solution for this effects.the effect example in there below.
http://apping.me/ios/4eb514ba8491783f5b0001e2/droste+vision.html
http://www.pmavridis.com/iDroste/iDroste.html
Please provide me suggestion or any tutorials link. How i will do that task?.Thanks in advance.
The Droste effect is a trick made with some intense mathematics and a recursive function. Please read http://www.josleys.com/article_show.php?id=82. If you don't know about recursion please read up http://en.wikipedia.org/wiki/Recursion. Since your request is very specific I doubt there will be many people who happen to have a Droste effect code written in the iphone programming langauge, but the links above should help you understand the math behind creating your own. Good luck.

Add a signature image to a pdf in iOS for the iPhone/iPad in particular

With the iOS support for Quartz 2D and its support for the PDF format; should adding a signature image to a pdf be a little easier. I have looked all over and saw people are using the PDFKit, UIView or Core Graphic Library. Which is the easiest and the recommended library for the effort? Also, are there simple examples of the recommend library. When I tried to see how Quartz 2D worked, all I could find are narrative explanations about how it worked and specific method you may use but no complete examples. You know the hello world one. Anyway, I am new to iOS development but been writing code for over 20 years so I might be able to pick this OS up as well.
Can some poor soul have pity on me and please point me in the right direction?
I have done this by loading the old pdf file on view and then add signature on that view and then render the view. check the following post
Add a signature image to a pdf without showing the pdf data to user in iOS
But not able create the pdf which contain existing pdf with signature "without showing on view" .
It's too late to answer this question now. But let me just provide some pointers for people who may bump into this question in future.
This one summarizes PDF handling in iOS pretty well. Good for starters.
http://www.ioslearner.com/generate-pdf-programmatically-iphoneipad/#more-242
This one is also similar, but not very exhaustive. http://www.absoluteripple.com/1/post/2012/03/generating-pdf-in-ios.html
The above links do not talk about handling existing PDFs. I found this stackoverflow answer really useful for that.
Add pdf page to an existing pdf objective-c
Just a note, if you want manipulate existing PDFs, Quartz 2d is the way to go.
Also look at reference pages of CGPDFDocument, CGPDFPage, CGPDFContext and CGContext.

Is it possible to get the page number and line number in iPhone

Is it possible to get the page number and line number of particular text from doc/rtf/pdf in iPhone sdk?
Can QLPreviewController or UIDocumentInteractionController be of any help?
EDIT:
I am trying to create something like iAnnotate,Sente. Application where in user will be able to select some text and can add comments for selected text.
I have gone through the fastpdfkit api's which seems the only api which can be of some help.
Can you guys guide me in the right direction.
https://github.com/brow/leaves
Go with this link, it will help you for PDF reader and you can see there how I am doing total page and current page.
If you're looking at doing this with PDF, RTF and DOC it might be best to approach it in a different way as they are all very different formats.
Instead - if you consider attaching comments to an area of the page as opposed to a specific text selection then all you need to know about the document is which page you're looking at. A much easier task. Then you get the user to 'drag out' a comments box for an area of that page. Think of them more like sticky-notes.
This way you can add comments to images as well as text and it allows a much more flexible system for support of other file formats in the future.
I realise this isn't I direct answer to the question, but thought it relevant enough to post.

Searching an image for specified text

I think I am going to ask very stupid Question here. In my current project i want to give search feature. I have an big image tutorial with lot of information about on a topic and i want to search feature in the image. Suppose use type like "Apple" it will show the Apple occurred how many times in the image and after clicking on of that the image scroll and go to the position where "Apple" is occurred.
Thanks for reading my stupid question but if it is possible let me know and put some sample code??
Here is a broad overview of the approach I would take:
Find a C/C++ based OCR library
Get it to compile on the iPhone
Create a UI to feed images to the OCR library
Store output of OCR, including words found and their location in the image.
Create a UI to allow users to enter a search.
Search OCR output for matches and highlight the location of matches on the image.
I imagine step 2 is going to be the most difficult. Tesseract may work, it is C++ based but I don't know what dependencies it has.
UPDATE: Someone on GitHub has posted a demo iPhone App that uses Tesseract.
Please try to do use WebView or Core Text to render you tutorial, in which search functionality comes pretty much for free. Use OCR for search is just not practical for your need.