PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 12, 2024 10:31 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Work with a text
PostPosted: Thu May 26, 2011 10:32 am 
Offline

Joined: Tue May 17, 2011 2:28 pm
Posts: 4
hi,

-1
I want to write a text with a lot of words in bold, is this possible?

-2
And it's possible to rotate a text (45°, 90°, ...) ?

thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: Work with a text
PostPosted: Thu May 26, 2011 11:59 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!

Yes.
Yes.

http://www.pdfsharp.net/wiki/PDFsharpSamples.ashx
http://www.pdfsharp.net/wiki/MigraDocSamples.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Work with a text
PostPosted: Wed Jul 27, 2011 8:30 am 
Offline

Joined: Wed Jul 27, 2011 8:23 am
Posts: 2
Hi,
where is the sample for rotate a text (45°, 90°, ...) ?
:?:
(XFont class has not the property :shock:)

Thanks
Riccardo


Top
 Profile  
Reply with quote  
 Post subject: Re: Work with a text
PostPosted: Wed Jul 27, 2011 8:42 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Rotation is not an XFont property, it's done with RotateTransform.
One sample:
http://www.pdfsharp.net/wiki/Watermark-sample.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Work with a text
PostPosted: Wed Jul 27, 2011 9:53 am 
Offline

Joined: Wed Jul 27, 2011 8:23 am
Posts: 2
Hi,
I found

XGraphics..::.RotateAtTransform Method (Double, XPoint)

public void RotateAtTransform(
double angle,
XPoint point
)

What meaure unit has angle ?
Degree ?

I have a rect to draw a string inside
What rect's point have I pass to Rotate ?

Thank you very much
Riccardo


Top
 Profile  
Reply with quote  
 Post subject: Re: Work with a text
PostPosted: Wed Jul 27, 2011 10:19 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Radians, not degrees.

Code:
// Define a rotation transformation at the center of the page
gfx.TranslateTransform(page.Width / 2, page.Height / 2);
gfx.RotateTransform(-Math.Atan(page.Height / page.Width) * 180 / Math.PI);
gfx.TranslateTransform(-page.Width / 2, -page.Height / 2);

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 20 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