I know this is a common question, but I can't find the way. Sorry.

How can I wrap vertical text in a pdfcell?

I tried using PdfTemplate-Image.

float columns[] = {0.5f,0.5f}
PdfPTable table = new PdfPTable(columns);
table.setTotalWidth(200);
table.setLockedWidth(true);

PdfTemplate template = writer.getDirectContent().createTemplate(100, 100);
BaseFont bf = BaseFont.createFont("Helvetica", "winansi", false);
String text = "This is the text that I'm trying to wrap";
float size = 16;
template.beginText();
template.setFontAndSize(bf, size);
template.showText(text);
template.endText();
Image img = Image.getInstance(template);

PdfPCell cell = new PdfPCell(img);
table.addCell(cell);

table.addCell("other cell");

Thanks a lot.

Gastón Scapusio

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: http://messenger.latam.msn.com/



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to