PDF to HTML in iPhone - 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.

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!

how to keep pdf format while using itextSharp

I am new in using itextsharp: i searched for how to keep pdf formatting while using itextsharp but found none. is there anything new about keeping pdf format in text?
please help. I want to keep format of page number and fonts of text headers and sub headers as in chapter heading etc

i want to change the pdf look into html look in html2pdf

I want to display HTML design page when converting the page in PDF format.
Is this possible to do? If yes, how?
Currently my HTML page is getting distorted when converting into PDF format while using html2pdf. My header is not as per I designed it.
How to set the value of header as per css?
The script i am using is PHP.
Basically i want to know can i replace my css with the html2pdf css creation?If yes , how and what is the process/procedure?
Please Guide.
Thanks
I resolved the query on my own.
I figured it out that PDF only recognises table and not div.
So when you write an html/ design it , write in table format not div. It does not recognise float.
Hence the above question i mark as resolved.
Thanks

iphone xml parses text but no images or paragraph spacing

i am trying to parse an xml blog found here: http://www.feed43.com/1515171705611023.xml
it has pictures within the text. I am able to parse the headers, the content and the link of the individual posts.
I, however, cannot get it to parse the paragraph spacing links within the text or images. all three of these are EXTREMELY important.
I am using this: http://github.com/mwaterfall/MWFeedParser with very few changes. most them having to do with appearances and the actual feed loaded as well as using a scroll view for the detail view instead of the table view shown.
note: it didnt load these things before I made changes either.
Can anyone help me?
What you are looking for is an html renderer, not an xml parser. On iPhone, that is WebKit, which can be used through UIWebView.
Extract the html embedded in the rss formatted xml and place it in a UIWebView using loadHTMLString. Usually, the baseURL will be the same as the rss source, without the filename.

How to upload contents of a file to a UITextView?

I have about twenty UITextViews and corresponding .txt files. What I want is to make each UITextView take the contents of the corresponding file and display it.
Moreover, the text is formatted and it contains some formulas (copy/pasted from Grapher). I've heard about displaying formatted text in UIWebView, but I haven't found a clear explanation anywhere.
Thanks in advance!
Text files normally don't contain formatted text.
If by "formatted" you mean "html" then yes, you will want to use UIWebView. Basically you will convert the text to an HTML document, and then use the web view to display that document. There are several example projects available from Apple that show you how to use UIWebView.
Displaying formula in a UITextView will be difficult as the character rules for formula are completely different from language text. You could generate HTML to display it that but that is difficult as well.
I think your best bet would be to draw the formula to an image and then display the image. That is the traditional way to handle the display of formula.