Hello List,

May I know how to how to auto-wrap a text please?

(1) I need display a text in an absolute position
(2) The text is very long more than 600 characters

I'd like the text to be auto-wrapped in the pdf file.


       PdfContentByte cb = writer.getDirectContent();
       float x = 30;
       float y = writer.getVerticalPosition(true) - 150;

          BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA_BOLD, 
"Cp1252", false);
          cb.beginText();
          cb.setFontAndSize(bf, (float)12);
          cb.setTextMatrix(x, y - 15);
          cb.showTextAligned(PdfContentByte.ALIGN_LEFT, "... text... ", 
x, y, 0);

          cb.endText();

Only part of the text is shown, it's auto-cutted but not auto-wrapped in 
the PDF.

Thank you,

-- 
Emi Lu

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to