PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 6:50 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Mar 21, 2008 6:34 am 
Offline
User avatar

Joined: Thu Mar 06, 2008 11:30 am
Posts: 10
Location: Tech-Tips-Now.com
Hello,

How to change the font size of Watermark Text ?

I have been using the sample C# code (PDF Sharp)

However, I am not sure how I can change/reduce the font size of the Watermark text.

I tried changing the value of the emsize, but there is no changes in font sizes.

Quote:
string watermark = WatermarkText;
const int emSize = 140;


There is no issue with watermark. I just want to reduce the font size.

BTW, I am using the 3rd method.

Please let me know.

Thanks

_________________
Subi


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 24, 2008 4:32 pm 
Offline

Joined: Mon Mar 24, 2008 4:21 pm
Posts: 1
dpsubi1 wrote:
I tried changing the value of the emsize, but there is no changes in font sizes.

Quote:
string watermark = WatermarkText;
const int emSize = 140;


Well, it's pretty simple. The const "emSize" is not used for watermark size, even though it was declared (presumably) for such purpose. So you have to correct the following line:

Code:
path.AddString(watermark, font.FontFamily, XFontStyle.BoldItalic, 150, new XPoint((page.Width - size.Width) / 2, (page.Height - size.Height) / 2), XStringFormat.Default);


The "150" after XFontStyle.BoldItalic is the font size, so change this to "emSize" or just put in your value.

Perhaps the samples should also be corrected to avoid confusion?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 25, 2008 3:51 am 
Offline
User avatar

Joined: Thu Mar 06, 2008 11:30 am
Posts: 10
Location: Tech-Tips-Now.com
Wow! thanks it worked great.

Thanks a lot for your help.

_________________
Subi


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 381 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group