Paulo Soares <psoares <at> consiste.pt> writes:

> 
> You can't mix addText() with addElement().
> 
> ----- Original Message ----- 
> From: "Nandu" <nandakishorem <at> hotmail.com>
> To: <itext-questions <at> lists.sourceforge.net>
> Sent: Sunday, October 30, 2005 5:54 AM
> Subject: [iText-questions] Adding bullet image to an ordered list

PdfContentByte cb = writer.getDirectContent();
ColumnText ct = new ColumnText(cb);
ct.addText(new Phrase("Data Item", font);
ct.go();
float yposn = ct.getYLine();

But I want to add a bullet image to each of the items as shown below.
<bullet.gif>     Item 1     
<bullet.gif>     Item 2
<bullet.gif>     Item 3
I have the bullet.gif file with me and I am adding it this.
ct.addElement(Image.getInstance("path to bullet.gif file"));
ct.addText(new Phrase("Data Item", font);
ct.go();
float yposn = ct.getYLine();

When I do this, everything goes haywire. I can see the bullet.gif in the
resulting PDF document, but I don't see the text by the side of it.
The whole list of ordered items is all messed up and 
everything is misaligned. What am I doing wrong?
Thanks for your help.

Regards,
Nandu

Hi,

Thanks for your response. If they can't be mixed, how do I ensure that the
bullet and the text are next to each other?

Thanks,
Nandu



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to