You are missing beginText/endText. 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Tietz, Andrew (KELLY SERVICES)
> Sent: Friday, July 01, 2005 10:08 PM
> To: [email protected]
> Subject: [iText-questions] Writing text in absolute positions
> 
> I'm a new moderatly new user and I'm building some very basic 
> PDF's with images and text.  Because of a list of reasons, I 
> want to use absolute positions on the text I enter, mainly 
> because the page does not flow like a normal document at all. 
>  I'm trying to set the contenByte to a particular (x,y) 
> position and then write a line of text.  Here is what I'm doing:
> 
> try { 
>         BaseFont bfArial = BaseFont.createFont( 
> "c:\\windows\\fonts\\arial.ttf", BaseFont.CP1252,             
>                   BaseFont.NOT_EMBEDDED);                         
> 
>                         cb.setFontAndSize( bfArial, 12f ); 
> 
>                         //Paragraph is an object wrapper I 
> used that wraps the iText paragraph object 
>                                 Paragraph paragraph = 
>                                         
> (Paragraph)template.getComponents().get( counter ); 
> 
>                                 cb.moveText( 
> paragraph.getX(), paragraph.getY() ); 
>                                 cb.showText( paragraph.getText() ); 
>                                 } catch (DocumentException e) { 
>                                         e.printStackTrace(); 
>                                 } catch (IOException e) { 
>                                         e.printStackTrace(); 
> } 
> 
> The program runs fine, except when I open the PDF, I get a 
> message "Illegal Operation 'Td' outside text object".  After 
> pressing OK, the PDF loads fine and the one line of text is 
> shown.  Any idea how I can get that error message to go away?? Thanks
> 
> Innovene USA 
> Strategy 
> D. Andrew Tietz 
> Ext. 38814 
> Cell 630.707.4229 
> 
> 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to