PDFsharp & MigraDoc Foundation https://forum.pdfsharp.net/ |
|
Work with a text https://forum.pdfsharp.net/viewtopic.php?f=2&t=1668 |
Page 1 of 1 |
Author: | newproger [ Thu May 26, 2011 10:32 am ] |
Post subject: | Work with a text |
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 |
Author: | Thomas Hoevel [ Thu May 26, 2011 11:59 am ] |
Post subject: | Re: Work with a text |
Hi! Yes. Yes. http://www.pdfsharp.net/wiki/PDFsharpSamples.ashx http://www.pdfsharp.net/wiki/MigraDocSamples.ashx |
Author: | riccardo.raccuglia [ Wed Jul 27, 2011 8:30 am ] |
Post subject: | Re: Work with a text |
Hi, where is the sample for rotate a text (45°, 90°, ...) ? ![]() (XFont class has not the property ![]() Thanks Riccardo |
Author: | Thomas Hoevel [ Wed Jul 27, 2011 8:42 am ] |
Post subject: | Re: Work with a text |
Rotation is not an XFont property, it's done with RotateTransform. One sample: http://www.pdfsharp.net/wiki/Watermark-sample.ashx |
Author: | riccardo.raccuglia [ Wed Jul 27, 2011 9:53 am ] |
Post subject: | Re: Work with a text |
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 |
Author: | Thomas Hoevel [ Wed Jul 27, 2011 10:19 am ] |
Post subject: | Re: Work with a text |
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); |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |