Hi,
A PDF is not a browser, while creating your HTML you should still bare
in mind that the end result will be a PDF.
Couple tips:
It's better to write measures in points (pt). Then no conversion is done
by the XMLWorker.
It's a good idea to check the supported tags (in the documentation or
inside com.itextpdf.tool.xml.html.Tags there are the defaults listed).
The <font> tag, used in the htmlfile, is not supported, that is why
among others the 'Test' text is not there. You can easily write a
TagProcessor that does support the font tag as you see fit.
If I'm correct it is better to define a width for your tables, then the
XMLWorker does not have to try and fit text in it. Nesting tables is
possible, but it makes it harder for XMLWorker to fit tables on the page.
Regards
Balder
On 14/10/2011 8:33, Mark Ramos wrote:
Hi,
Thanks for the links Balder.
I tried to render the enclosed html file to pdf and I did not get a
good result. Please check the attachments.
I used this code snippet:
Document document = new Document(PageSize.LETTER);
PdfWriter instance = PdfWriter.getInstance(document, new
FileOutputStream("/home/mramos/html3.pdf"));
document.open();
FileReader br = new FileReader("/home/mramos/pdf_cfadmin2.html");
XMLWorkerHelper worker = XMLWorkerHelper.getInstance();
worker.parseXHtml(instance, document, br);
document.close();
Any help is much appreciated.
Many thanks!
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
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
--
twitter <http://twitter.com/redlabbe>
redlab-log <http://www.redlab.be/blog/>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
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