  | 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 | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | -none- | -none- 2007-10-02 - By Alex Jacoby
Back It seems that the current rtf page numbering system is either broken or incompatible with the RTF viewers I have on my mac (OpenOffice 2.2 and Word 2004). My generated RTF files are missing their page numbers in the footer, and worse, *the example RTF file on the iText website doesn't work either*: http://itext.ugent.be/library/com/ lowagie/examples/rtf/extensions/hf/ExtendedHeaderFooter.rtf
I'm new to itext, but I've spent hours pouring over available documentation, mailing list archives, and sample code. Any ideas?
Thanks, Alex
ps- The relevant code, basically identical to example on website:
import com.lowagie.text.Document; import com.lowagie.text.Element; import com.lowagie.text.Font; import com.lowagie.text.PageSize; import com.lowagie.text.Paragraph; import com.lowagie.text.Phrase; import com.lowagie.text.Rectangle; import com.lowagie.text.rtf.RtfWriter2; import com.lowagie.text.rtf.field.RtfPageNumber; import com.lowagie.text.rtf.headerfooter.RtfHeaderFooter;
... // Page Footer Paragraph footerText = new Paragraph("Page "); footerText.add(new RtfPageNumber()); RtfHeaderFooter footer = new RtfHeaderFooter(footerText); footer.setAlignment(Element.ALIGN_RIGHT); footer.setBorder(Rectangle.NO_BORDER); doc.setFooter(footer);
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|
 |