I have an html file with contents:
<html>
<body>
<p>
<b>this is bold</b></br>
This is not in bold
</p>
</body>
</html>
When I run XmlWorker I get this exception:
Exception in thread "main"
com.itextpdf.tool.xml.exceptions.RuntimeWorkerException: Invalid nested
tag br found, expected closing tag p.
public TestHTMLWorker() throws Exception {
Document document = new Document();
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream(
"/home/jberk/desktop/HTMLtoPDF.pdf"));
writer.setInitialLeading(12);
document.open();
XMLWorkerHelper.getInstance().parseXHtml(writer,
document,
new FileReader(PROJECT_DIR +
"/test.html"));
document.close();
}
If I change "</br>" to "<br></br>" it works.
Jason Berk
[email protected]
www.purduefed.com
800.627.3328 x8902
This is a transmission from Purdue Federal Credit Union (Purdue Federal) and is
intended solely for its authorized recipient(s), and may contain information
that is confidential and or legally privileged. If you are not an addressee, or
the employee or agent responsible for delivering it to an addressee, you are
hereby notified that any use, dissemination, distribution, publication or
copying of the information contained in this email is strictly prohibited. If
you have received this transmission in error, please notify us by telephoning
(765)497-3328 or returning the email. You are then instructed to delete the
information from your computer. Thank you for your cooperation.
------------------------------------------------------------------------------
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. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
iText-questions mailing list
[email protected]
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