Op 8/02/2011 8:53, [email protected] schreef:

Hi All,

In our project, we are having 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).

Is the image at that location on the D: drive? (That would surprise me.)
Normally, when you parse HTML containing images, you implement the ImageProvider interface.
You create the Image object in your implementation of the getImage() method.
Why? Because the working path of your application isn't necessarily the basepath of the image source.
Not can you be sure that your application can connect to the internet.
This is explained in chapter 9 of "iText in Action - Second Edition."

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?


Are you saying that you want the image to appear as content AND add the image as a file attachment annotation or as a document level attachment? In that case, you'd need to adapt HTMLWorker.

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.


Is that so? PdfPTable is supported in HTMLWorker, but maybe you're defining the table using CSS instead of using <table>, <tr> and <td> tags. That's not supported in HTMLWorker.

If you'd read the documentation, you'd find out that iText is NOT a full blown HTML to PDF convertor. Unfortunately, you first write plenty of developers personally, and then post a question on the list, without investigating first. We'll take your question in consideration for the next iText FAQ top 5: http://lowagie.com/node/75


PS:
you have posted a mail to [email protected] but you weren't subscribed.
You are receiving this answer because I've added your mail address in Bcc:
I will do this only once! Further answers will be sent to the mailing-list only (you won't receive them if you don't subscribe). Further questions to the mailing-list will be rejected unless you subscribe. Further questions sent to the 1t3xt address will be ignored. Please understand that, as long as you don't subscribe, somebody has to MANUALLY approve your mail among a huge load of SPAM. You can help us avoid this boring administrative job by following the rules: http://itextpdf.com/support.php
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to