HTML to PDF convertion and editing in iOS - html

I am creating an iPad application for reading PDF, this PDF should be generated from a HTML file. I have seen some sample codes for converting HTML to PDF, and I think that part will be fine for me to implement.
I have seen some apps from from AppStore for reading PDF files, in that there is an option for increase the font size (not zooming), color style etc. When we increase the font size the text content automatically wrapping to next line. How can I implement this in my app? Any idea about how would they have done that?
I have seen in some posts that, it is not possible to edit a PDF file, so are they actually using PDF file or some other format?

When rendering your PDF to show it to user, you can convert it in other formats like HTML and then allow user to change font-size, font-style. So your PDF remain unchanged. Also it is easy to manipulate HTML than binary formatted documents like PDF.

Related

embed a pdf archive like it were part of the html code

i had a little question, i want to embed a pdf like it were part of the website, i could rewrite the pdf in html but it will be a lot of work, what would be the best looking option to embed it?
The pdf has pictures and letters with fonts and columns.
Thanks.
I would go with one of the two approaches. One is a native rendering of the PDF content in a DOM node, using PDF.js. It is an open source library that's used as the default PDF viewer in Firefox.
Another way is to emulate the look by converting the PDF pages to images when the PDF is uploaded. You may use imagemagick to parse the pages, and display the content in a slideshow/gallery widget.

Miniaturize pdf with css and html

I am looking to miniaturize a pdf in css and html.
when I click on my button it shows the pdf in a new tab, but I would like to see this pdf in small before clicking.
Is it possible ?
The main use of providing a miniaturized preview is to save bandwidth. So you probably wanto to provide some smaller version (e.g. a static image of the first page in .png format) of the PDF you want to preview, and will probably need some server-side scripting framework with PDF support, e.g. python-django, ruby-sinatra, php or the like.

Transforming Wysiwig HTML to PDF output

Using "wkhtmltopdf" as a PDF generator, and CKeditor as a Wysiwig editor, the font-size looks different between what I see in my browser, and what is shown in the PDF.
I tried many things: changing the font-size to cm/px/pt, changing the font-size percentage on the body ... but I can't find a way to have the same look in my HTML editor and in my PDF.
Is there some kind of link between PDF font-size and html one's ? Is the output in a PDF smaller than the one in a browser ?
Does someone already managed to obtain the same look in a WebBrowser than in a PDF using those kind of PDF generation tool ?
I found a satisfying solution.
I tried to import font using #font-face, but this doesn't work for me, because multiple #font-face for each "style" (italic, bold, bold+italic) was not recognized by wkhtmltopdf.
I had to use a "free" font ("DejaVu Sans" in my case) that was available on my Windows system and on the Linux Server and is directly available by the system when it generates the PDF.
Those two fonts now renders similarly between my Wisywig and the PDF generated. I also had to use a lot of CSS rules to make it clean, removing PNG images ... but that's another story.

Using IcePDF or PDFBox to generate HTML page from PDF

I want to use IcePDF or PDFBox to extract content from PDF. But I don't now the way to continue generating HTML web pages from the text and images extracted.
You can convert pdf to html with PDFBox. Try this link.
By adding -html as parameter when you extract text, you will get html of the pdf. But it will not contain any image, graphics and other details. It will be only the text extracted from the pdf in html format.
If you want to create the exact look and feel of the pdf, there is no single step method in PDFBox. In my knowledge no library provides this facility to create exact html of the pdf. But using PDFBox you can extract images, text and its details. Using these details you have to create a logic to produce the html. We have done a project to convert pdf to html for azzist.com. We have accomplished the conversion using PDFBox. In azzist we are converting the resume to html format. (Still some font issues are there).
Scribd, google, dropbox, zoho etc have accomplished this conversion in a better way. You can have a look at any of these sites to check how they have accomplished this. (You will not get the logic. You have to find it out).

Display/Render RTF doc in browser display using html textarea or something similar

My web application has an feature wherein preformatted RTF documents are used as templates and the user can select the source of data and then merge with the RTF documents templates to create merged RTF files. The RTF templates have placeholders which get replaced with user selected content. The final doc can either be saved or opened directly if word/wordpad is available on the local users machine.
Now, I have a requirement to display the merged document to the user for confirmation. The user may either print or save the document to the system directly. The display should not be word/wordpad application but should be within the application itself, using textarea or something similar to render the document. Can you please let me know if its possible to render the RTF document in textarea or not. Along with the displayed content, there should be options to print and save the document.If I have to convert the RTF to Html and then display the html content in textarea , please let me know how i can do the conversion and then display the html in the page.
That's a very difficult requirement. First of all, let's dismiss the idea about a <textarea>, because it does not support any formatting at all. All the WYSIWYG editors you've seen out there are based on <iframe>s.
Secondly, no browser can directly display a RTF. You can embed it as an <object>, and some might show it (IE probably will), but I can't say which ones won't. Portable devices almost certainly won't. But you should test this though, maybe it works well enough after all.
Failing that, HTML conversion is also out of question, because RTF has very very many features that cannot be emulated in HTML. There are some converters out there (google), but but they will all come with serious limitations. If you want full support, you will have to do your own rendering via Canvas or Flash or something.
To this end I'd suggest checking out Google Docs. They've gone through all of this hassle and have a rather feature-full engine for displaying most possible documents. I think it was also possible to embed them in your own webapges, though I've never checked it out myself.
Use a <PRE> tag to Display/Render RTF doc in browser.