You can't mix addText() with addElement().

----- Original Message ----- 
From: "Nandu" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, October 30, 2005 5:54 AM
Subject: [iText-questions] Adding bullet image to an ordered list


> Hi,
> 
> I am using ColumnText class and its methods to write a ordered list
> of items in my PDF document and keeping track of the Y-position --
> some thing like shown below.
> 
> PdfContentByte cb = writer.getDirectContent();
> ColumnText ct = new ColumnText(cb);
> ct.addText(new Phrase("Data Item", font);
> //ct.addText() invocations...
> 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
> 
> 
> 
> -------------------------------------------------------
> 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


-------------------------------------------------------
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