Underscores don't show because they are below the baseline. Other
characters with descenders, such as 'p', will also be cut.
Set the template bbox with some negative slack:

template.setBoundingBox(new Rectangle(0, -20,
document.getPageSize().width(), document.getPageSize().height()))

Best Regards,
Paulo Soares

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, March 25, 2004 9:13 AM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] PdfTemplate and UNDERLINE question
> 
> 
> Hello Everyone!
> 
> Is it possible to write and UNDERLINE/UNDERSCORE using PdfTemplate?
> 
> I've been trying this code and it seems to be not diplaying the
> pFont.getFixedText() when it is composed of UNDERSCORES ("______" ).
> Dashes ("------") and other characters are displayed properly though.
> 
> template = contentByteUnder.createTemplate( 
> document.getPageSize().width(),
> document.getPageSize().height() );
> template.beginText();
> template.setFontAndSize( baseFont, pFont.getFontSize() );
> template.setColorFill( new Color( pFont.getRed(), pFont.getGreen(),
> pFont.getBlue() ) );
> template.showText( pFont.getFixedText() );
> template.endText();
> template.closePathStroke();
> contentByteUnder.addTemplate( template, getAbsolutePosition( 
> pFont.getX1() ),
> getAbsolutePosition( pFont.getY1() ) );
> 
> 
> Thanks in advance for the help!
> 
> 
> Paul
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> 


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to