By Date: <-- -->
By Thread: <-- -->

Writing text in signature appearance which doesn't get cut



PdfSignatureAppearance.fitText(). You can also use ColumnText to break
lines, etc. 

> -----Original Message-----
> From: itext-questions-admin (at) lists.sourceforge.net 
> [mailto:itext-questions-admin (at) lists.sourceforge.net] On 
> Behalf Of Wahaj Khan
> Sent: Tuesday, January 31, 2006 10:15 AM
> To: itext-questions (at) lists.sourceforge.net
> Subject: [iText-questions] Writing text in signature 
> appearance which doesn't get cut
> 
> Hi guys,
> 
> I am trying to write some text in a signature appearance 
> using PDFTemplate.
> 
>           n2.beginText();
>           BaseFont bf = BaseFont.createFont("Helvetica", 
> BaseFont.WINANSI,
> false);
>           n2.setColorStroke(java.awt.Color.BLUE);
>           n2.setFontAndSize(bf, FONT_SIZE);
>           n2.setTextMatrix(10, 100);
> 
>           n2.showText("This is a very very long text so 
> please scale this
> text");
>           n2.endText();
> 
> In case the signature appearance is small, the text above 
> gets cut. I need
> to set a font based on the size of the signature appearance 
> so that the full
> text is shown. One way is to find the right balance by hit 
> and trial i.e.if
> the width of the n2 is so and so then font size should be so 
> and so if the
> text size is in a particular range. This is cumbersome, I was 
> wondering
> whether there is some function which can tell me how much 
> area a text would
> take i.e. the above text if using a particular font would 
> take 100 pixels. I
> can then compare with the n2's width and if the text get cut 
> then reduce the
> font size and again check. Is there any function or way ?
> 
> Thanks for reading..
> 
> Regards,
> Wahaj
> 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions