Copy link to clipboard
Copied
I am working on converting the PDF into a HTML document. Using the Adobe export API I could convert my PDF into .docx or .png files but I couldn't find any documentation to convert into HTML format. I see that in the Adobe DC application I was able to convert the PDF to HTML and I was hoping this would be possible using the API. Is there any documentation or any way I could use to convert the PDF to HTML?
Thanks you!!
Extract will product a JSON with an elements property. The elements is an array of objects that corresponds to each "chunk" of text in the PDF. There are two properties in each element that will be of interest when creating the HTML. The Path and the Text. The Path will end in one of the element types listed here. Most of them are also HTML element names that you'll be familiar with. The Text is... you guessed it... the text of that element.
Tables and Lists get interesting but those are still
...Copy link to clipboard
Copied
The Extract API will output JSON which can easily be used to generate HTML on the fly.
Copy link to clipboard
Copied
Thanks for the reply. Actually that is a great approach, extracting the JSON and generating the HTML from it. I will take a look at the JSON output and try to use it to generate the HTML.
Could you suggest me any resources or any process to do this task. I was searching online and all I could find is converting the JSON into HTML tables.
Thanks.
Copy link to clipboard
Copied
Extract will product a JSON with an elements property. The elements is an array of objects that corresponds to each "chunk" of text in the PDF. There are two properties in each element that will be of interest when creating the HTML. The Path and the Text. The Path will end in one of the element types listed here. Most of them are also HTML element names that you'll be familiar with. The Text is... you guessed it... the text of that element.
Tables and Lists get interesting but those are still pretty easy to read. That said, you can extract the tables as CSV and then easily render those to HTML. There are number of code samples that will do that for you.
I'll be sharing some code that I have that does this soon.
Copy link to clipboard
Copied
I used the normal text extract(without any styling) output from the Extract API, and was able to convert into a HTML using the properties. In the JSON output(text extract without any styling information) the list elements are considered as heading tags so didn't have to worry about them but tables took some time to figure out. I couldn't understand how to use the font data and also the background color information because of their format. That being said, so far my HTML looks far more better than any other software or packages that I used.
Could you share the code you were saying so that I could have even better understanding and also could improve my approach. Thanks.
Copy link to clipboard
Copied
Here's a link that has working samples. Ofcourse @Joel_Geraci might have some better samples.
Also, did you manage to accomplish the conversion? Are converting in to HTML for web viewing or for emailing?
Thanks!
Copy link to clipboard
Copied
Curious to see the business logic on how you have rendered the HTML from JSON output. Can you point me to the code samples, please? Thanks a ton
Copy link to clipboard
Copied
Did you find any framework or API which will create HTML from Json output?
Copy link to clipboard
Copied
Hi @Joel_Geraci ,
Can you please share sample code of PDF extracted JSON to HTML page?
Thank you in advance.
Copy link to clipboard
Copied
Hi Yuvraj Kale,
Are you create the html page from PDF extracted JSON?
Thanks you
Copy link to clipboard
Copied
Hey,
I am still waiting for answer on this. We want to convert PDF to HTML, but unable to find correct library which can do this.
It would be great if you can share any reference regarding this.
Thanks,
Copy link to clipboard
Copied
Is there any information known about whether the PDF to HTML conversion will be included in the API in the future? I need the output to be the same as I get when converting via adobe acrobat with layout, tables, font, etc.