I needed to covert PDF documents into HTML. where i can achieve below.
1-Extract the text from the PDF.
2-extract the images
3-Retain the formatting in the newly converted HTML page same as that of PDF page.
4-To embed the images into the newly converted HTML page in the appropriate places as that of PDF.
5- Applying color scheme to HTML page.
Any help would be appreciated.
To extract images from PDF
Image Extraction
To extract text from PDF
Text Extraction
All the other things you are seeking answers for are possible using any web-application setup.,
Related
We have a project where we use pdf.js to render a PDF into webpage and it creates HTML container elements for the PDF pages. The content of the PDF is split as HTML span in the view.
Attached is the image which shows how pdf text is rendered in the view. It also shows, each span has a data-key does not corresponds to a line in PDF.
Now, I need a pdf reader for java which reads and breaks the content as span with data-key or just the span in the order.
There are lot of java libraries available to read PDF content which gets the content line by line but that does not solve my issue. I need a java library which could break the content equivalent to span in the view.
I am developing a Wordpad application using Java Swing.
I am using JTextPane component. I have added the code for Bold, Italics, Underline. I am adding the code to insert images in all the formats.
My expected scenario: I want to save the document with all these styled content with the extension '.doc' (or)'.docx'. And I want to read and open the document which contains these types of styled content like Bold, Italic, underline text and images, bullet points etc..
I don't think it can be done with HTMLEditorKit().
Can anyone help with the sample code for saving and reading these styled contents to/from external file?
Thanks in advance.
I have to edit an existing pdf file using itext in java. My problem is in the existing pdf it contains lots of pages. When inputting the page number of that existing pdf i have to edit the footer of that page to a new text and have to output only that page with edited footer page along with the page contents in that page. No need to output the remaining pages. Also the existing pdf is in A6 format and I have to change the output pdf to A4 format. How it is possible?
You can split and merge PDF files using iText. That means, you need to split your original document into three parts and keep only the middle (required) part. You can also delete and add objects. That means you can find the footer object, delete it and and add a new object in its place. I do not think you would be able to change the format. Unless, you can create a brand new document in the target format and copy the objects from the source into the new document. Worth trying.
How to convert the pdf into the word doc file?
The pdf file was generated by JasperReports and which has one table in which one column contains text with html body part like <p><b>test</b></p>
So I just want to convert this pdf file in doc with proper formating like text display in bold format.
Much of the format information is removed in converting a file into a PDF so you can not just convert it back unless the PDF was created as Marked content with additional meta tags in it.
I wrote a blog article explaining about PDF text at http://www.jpedal.org/PDFblog/2009/04/pdf-text/
Pro grammatically you can do it with Apachi POI. You can first read the PDF and then write it to a Word Doc using the API.
How can I convert an HTML page to an image or PDF and then convert it to byte array?
I've used PrinceXML as a tool to convert from html to PDF before, it worked excellently.
It depends. In the way of pdf, do you just want to embed the image or should it be text? If text, it's very individual. And Image to Bytearray have a look at the ImageIO class of java.
To convert html to pdf this link maybe helpful:
http://kac-ani.xt.pl/en/node/27