>From: SALAZAR, DANTE [mailto:digitron...@cwpanama.net]
>Sent: Thursday, July 18, 2013 6:21 PM
>To: itext-questions@lists.sourceforge.net
>Subject: [iText-questions] Printing in bold

>I am writing a form using ShowText

>First I defined: basefont bf and  PdfContentByte cb
>Then I set the font and size of cb:        cb.SetFontAndSize(bf, 12)

>Finally I fill in the form with:
>        cb.SetTextMatrix(100, 200)
>        cb.ShowText("Text to be printed 1")
>
>        cb.SetTextMatrix(100, 400)
>        cb.ShowText("Text to be printed 2")
>
>How can I do to print "Text to be printed 2" in bold?

What if you create a Chunk and set the text of the Chunk to bold font, then 
maybe this:

Chunk text2 = new Chunk("Text to be printed 2", Font.BOLD);
cb.ShowText(text2.getContent());

I haven't tried it, so not sure if it works.

Leo

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to