4

I am converting PDF document into HTML using poppler utility. But its creating separate html file for each page, but I want a single HTML file after converting pdf to html.

I used following syntax:

pdftohtml -c abc.pdf

But its creating abc-1.html, abc-2.html, .... etc

I also tried with pdftohtml -c abc.pdf abc.html but not getting expecting output.

Can anyone tell how to get a html output in single file instead of multiple html files?

Deepti Kakade
  • 3,053
  • 3
  • 19
  • 30

2 Answers2

5

I have achieved this with -s option

For example:

pdftohtml -c -s -noframes abc.pdf abc.html
Deepti Kakade
  • 3,053
  • 3
  • 19
  • 30
  • @ Deepti Kakade :its working fine for me but i am getting an issue. its creating ALL PAGE WITH LEFT ALIGNMENT. IT SHOULD BE SAME THAT WAS IN PDF. Do you have any idea how can i do ? – Ashish Kumar Saxena Jan 14 '16 at 06:58
  • I have to say a BIG Thank you, I totally missed the '-noframes' flag :-) – funder7 Mar 29 '20 at 05:28
0

The question is old but needs to be supplemented with information

The solution with pdftohtml works but loses the formatting

Preserves formatting is pdf2htmlEX

On new builds of Linux, this package is not present and deb packages are not installed

Only works through docker

sudo docker pull bwits/pdf2htmlex

sudo docker run -ti --rm -v /home/user/Documents/pdfToHtml:/pdf bwits/pdf2htmlex pdf2htmlEX --zoom 1.3 file.pdf
Rony Macfly
  • 210
  • 2
  • 4
  • 10