I must be missing something easy. I am trying to add several lines of text to a 
template. I figured that newlineShowText() or newlineText() would move the 'cursor' 
down one line. Is that incorrect, or am I misusing them? 

With this code, I was expecting to get 10 lines on the template, but I only get one, 
each overwriting the other.


            PdfContentByte cb = writer.getDirectContent();
            PdfTemplate template = cb.createTemplate(500, 500);
            BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, 
BaseFont.NOT_EMBEDDED);
            template.setFontAndSize(bf, 12);
        template.beginText();
            template.setTextMatrix(100, 200);
            for( int i=0; i<10; i++ ) {
                template.newlineShowText("Line : "+i);
                template.newlineText();                 // try both newline commands
            }
            template.endText();
            cb.addTemplate(template, 100, 400);


Do I have to keep track of the height of the text, and move the 'cursor' my self, with 
.setTextMatrix() each time I write a line?

Thanks,
Chris


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to