user243542
user243542

Reputation: 251

IText API convert HTML file to PDF - Formatting and Image rendering issues

We have a requirement to convert HTML file to PDF file. For that, we are using IText API. If the HTML has some image in its body, IText API fails to put that image in PDF and it throws the following exception.

ExceptionConverter: java.io.FileNotFoundException: D:\cid:870001313@01022011-2B8B (The system cannot find the file specified).  
  1. If the HTML has some image in its body then is it possible to read that image and make it as attachment to that PDF file?

  2. If the HTML has some tables then the generated PDF loses the table format and simply puts the data in PDF. We need the table in the generated PDF as it is in the HTML.

Do you have any solutions or suggestions for the above two issues? If you have any other API apart from IText which will fulfill our requirement, please suggest.

Upvotes: 0

Views: 2268

Answers (1)

Mark Storer
Mark Storer

Reputation: 15890

A: iText HTML->PDF converter isn't all that good, thought it looks to be getting some attention in the immediate future.

B: I'm going to guess there's some script stuff going on there, which even a Really Souped Up iText will never handle.

Check out wkhtmltopdf. It uses web kit for all its rendering (including javascript handling).

Upvotes: 2

Related Questions