Philip Hristov wrote:

Hello,

First of all I would like to thank you for the great component! However I am experiencing difficulties with one thing. I would like to show text with font, size AND font style (bold, italic, underline) and rotate it vertically. Of course I am trying to use PdfContentByte but I managed to show vertical text but without setting the font style and color. Here is what I’m doing:

PdfContentByte cb = Writer.directContent;

BaseFont baseFont = BaseFont.createFont(@”C:\windows\fonts\arial.ttf”, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

cb.beginText();

cb.setFontAndSize(bf, 12);

cb.SetTextMatrix(template, 0, 1, -1, 0, 500, 200);


cb.showText("Hello!");
cb.endText();

How can I show this text with blue color and underlined?

You weren't subscribed when you posted your question.
It was held by the list server at SourceForge and it seems
that this service was constipated: today I received over 200
mails dating from december (I removed all the SPAM mails
so that they don't reach the list).

Anyway: to change the color of the text to blue, use
cb.setColorFill(new Color(0x00, 0x00, xFF));
before showing the text.
Drawing a line is done with
cb.moveTo(x1, y1)
cb.lineTo(x2, y2)

But if you want a more user-friendly way, have a look
at class ColumnText. It can be used to put high-level
objects at absolute positions.
br,
Bruno


-------------------------------------------------------
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://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to