2

I am trying to convert a PDF document to a single HTML file in java. Most of the converters online converts one PDF file to multiple HTML files. I want to convert the whole PDF to a single HTML file.

Any suggestions?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Ahsan Abid
  • 609
  • 1
  • 7
  • 9

3 Answers3

3

Any suggestions?

You might always write some code using the JSoup API to write a single document that incorporates the body of each of the multiple HTML files. Combining styles & style-sheets (CSS) might be a bit more tricky (especially if the original HTML uses 'id' elements).


Though I find it hard to believe there is not a converter out there in which 'single document' is an option. I recommend searching further.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
0

I think it should be possible to parse your PDF document with itext and then generate your html file. I must admit I haven't checked if it is doable though.

C.Champagne
  • 5,381
  • 2
  • 23
  • 35
0

Have you looked at http://www.jpedal.org/html_index.php which has an optiont to write to single file.

mark stephens
  • 3,205
  • 16
  • 19