Works for me.

----- Original Message ----- From: "Baker, Gregory M" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, December 16, 2005 9:30 PM
Subject: [iText-questions] PDF Columns not displaying


I hope somebody can give me a suggestion on a problem I am having.

We have a routine to create a PDF file using iText.  This routine always
uses a template.  I am trying to use a column so that I can write out a
large comments field with automatic wrapping.  However, no text is ever
displayed on my document.

An example of my code is below.  Any ideas?

PdfContentByte cb = writer.getDirectContent();
document.newPage();
PdfImportedPage page = writer.getImportedPage(reader, pageNumber);
cb.addTemplate(page, X, Y);
BaseFont helveticaFont = BaseFont.createFont(BaseFont.HELVETICA,
BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
Font font = new Font(helveticaFont, 8, Font.NORMAL);
Phrase fContent = new Phrase("testing\n", font);
ColumnText ct = new ColumnText(cb);
ct.setSimpleColumn(fContent,100, 300, 200, 500,
15,Element.ALIGN_CENTER);
try
{
 ct.go();
}
catch (Exception e)
{
 System.out.println("error trying to write field: " + e.getMessage());
}

Attachment: test.pdf
Description: Adobe PDF document

Reply via email to