  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | HTML-formatted text | HTML-formatted text 2006-08-28 - By itextlist.gd@(protected)
Back Hi,
In my app I have to create PDF hard copies of the reports created on the screen (Save as PDF) The header of a report is defined by the user himself. He's allowed to use HTML formatting to format the header according to his whishes. A possible (simple) header string could be:
<div style=\"color:red; font-size:16px\">This is the header in red.</div>
Now the only possible way to add HTML formatted text to a PDF document I found is using HtmlParser.parse():
String content = "<div style=\"color:red; font-size:16px\">This is text in red.</div>"; java.io.StringReader reader = new java.io.StringReader ("<p>"+content+"</p>"); com.lowagie.text.html.HtmlParser (document, reader);
This works OK.
Now my question is this: how can I get (a reference to) the Chunk, Paragraph, Section or wathever element iText creates when it writes that HTML formatted text in the PDF file?
In fact I want to create a table with that HTML formatted text in one of the cells. Is that possible? In that case the method HtmlParser.parse(document,...) doesn't help me much. How do I do it?
Second question: (How) can I position that HTML-formatted text absolutely?
Kind Regards, Geert Delmeiren
PS. Bruno, I recently discovered you're a compatriot of me ;?) Nice work iText is!
-- http://www.fastmail.fm - And now for something completely different?
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|
 |