There's always a way. See the code snippet.
if (element instanceof com.lowagie.text.List) {
com.lowagie.text.List list = (com.lowagie.text.List)element;
ArrayList items = list.getItems();
for (int k = 0; k < items.size(); ++k) {
ListItem item = (ListItem)items.get(k);
ColumnText.showTextAligned(cb, Element.ALIGN_LEFT, new
Phrase(item.listSymbol()), left, currentY - 16, 0);
ColumnText ct = new ColumnText(cb);
ct.setSimpleColumn(item, left + list.symbolIndent(), 0,
right, currentY, 16, Element.ALIGN_LEFT);
ct.setLeading(0, 1.5f);
ct.go();
currentY = ct.getYLine();
if (currentY < bottom) {
currentY = top;
doc.newPage();
}
}
}
Best Regards,
Paulo Soares
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Tariq Chalabi
> Sent: Thursday, July 15, 2004 10:23 AM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Indenting List using PdfContentByte
>
> Hi,
>
> I'm producing a letter-type document from a servlet - and I've used a
> PdfContentByte in conjunction with a ColumnText to set the
> position of things
> like the addresses, date fields etc
>
>
> Everything appears to work fine.
>
> However - in the actual body of the letter, there is an ordered list.
>
> I would like the text to display indented from the number -
> similar to the List
> class. However - there doesn't seem to be a way to combine
> List and ColumnText.
>
> Is there a work-around for this
>
> Many thanks
>
> Tariq Chalabi
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id040&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions