Christian wrote: > Hi All > > I’m not able to find a method to write Html text into a Template. I must > use a Template cause of I don’t know the number of the total pages.
Please clarify. Saying "I must use a Template cause I don't know the number of the total pages" is like saying "I must eat an apple, because I don't know if 1 plus 1 is two". Why do you need to use a Template? What do you mean by Template? Is it an existing PDF file? Is it a PdfTemplate object? Specify! > I’ve create a class called DocElement that extends Paragraph and > implements DocListner Huh? Why? What does it do? > I’ve used HTMLWorker to write Html text into a DocElement object OK. > I’ve added the DocElement object to a PdfPCell of a PdfPTable Wow, why that introduce that much complexity into your application? > I’ve write that PdfPTable to the PdfTemplate using the method > writeSelectedRows Aha, you're talking about using PdfTemplate. Please explain why you need to use PdfTemplate. Wouldn't ColumnText do the trick? > It works fine for all html tags except for tag table. > > So If my Html is > <p>before<table><tr><td>Col A</td><td>Col B</td><td>Col > C</td></tr></table>after</p> > In the PDF I can see only “before after” without the table. Do you see the table if you try converting the same HTML to a PDF file using nothing more than document.add()? > If I add the DocElement object to the Document instead of the > PdfTemplate, the Html text is write correctly with the table too. > > How can I write the Html text correctly to the Template too? Your question is overly complex; you're mixing all kinds of concepts, and we have no idea where to start reading. Please use Occam's razor to distill your question to something we can understand. -- This answer is provided by 1T3XT BVBA http://www.1t3xt.com/ - http://www.1t3xt.info ------------------------------------------------------------------------------ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
