Page 1 of 1

Automatic watermark font size

Posted: Tue Oct 30, 2007 2:42 am
by Stéphane
Hello,

I try to adjust automatically the font size of the watermark text in order to fill the whole page. How can I accomplish this ? Any ideas ?


Cordially,
Kakone.

Automatic watermark font size

Posted: Wed Oct 31, 2007 2:12 pm
by Vital
Please place following code in BeforePrintEvent of page:

Code: Select all

StiText text = new StiText();
text.ClientRectangle = Page1.ClientRectangle;
text.Text.Value = Page1.Watermark.Text;
text.Angle = Page1.Watermark.Angle;
text.Page = Page1;
text.Font = new Font(Page1.Watermark.Font.FontFamily, 1020);
Page1.Watermark.Font = text.GetActualFont(Page1.Watermark.Text);
Thank you.

Automatic watermark font size

Posted: Fri Nov 02, 2007 11:17 am
by Stéphane
It's perfect !

Thanks a lot.