PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Vertical Text
PostPosted: Sun Jan 17, 2010 6:27 pm 
Offline

Joined: Mon Jan 11, 2010 5:35 pm
Posts: 9
How do I display text vertically? Is this even possible with PDFsharp or MigraDoc?

If not, could anyone let me know how it can be done or some kind of work around?

Thank you for any help.


Top
 Profile  
Reply with quote  
 Post subject: Re: Vertical Text
PostPosted: Mon Jan 18, 2010 10:30 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
It surely works with PDFsharp.
Simply use rotation.

A sample that uses rotation:
http://www.pdfsharp.net/wiki/XForms-sample.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: Vertical Text
PostPosted: Mon Jan 18, 2010 4:51 pm 
Offline

Joined: Mon Jan 11, 2010 5:35 pm
Posts: 9
Great, thank you.


Top
 Profile  
Reply with quote  
 Post subject: Re: Vertical Text
PostPosted: Wed Jan 27, 2010 6:11 pm 
Offline

Joined: Mon Jan 11, 2010 5:35 pm
Posts: 9
I'm having some trouble:

Following the sample you directed me to, I cannot get the text to rotate. This is my code (vb):

Code:
Dim gfxRotate As XGraphics = XGraphics.FromPdfPage(page)
        gfxRotate.DrawString("Principal", SmallBoldFont, XBrushes.Black, New XPoint(20, 550))
        gfxRotate.RotateAtTransform(75, New XPoint(20, 550))


but it does not rotate the string. Am I using it wrong? Could you provide an example that rotates a DrawString() please?

Thank you


Top
 Profile  
Reply with quote  
 Post subject: Re: Vertical Text
PostPosted: Wed Jan 27, 2010 7:29 pm 
Offline

Joined: Mon Jan 11, 2010 5:35 pm
Posts: 9
Problem solved. I put the RotateAtTransform line before the DrawString and it worked.
Sorry for not trying that first before posting, but I was following the sample.

For anyone who needs a simple way to rotate their text, here is my code:

Code:
Dim gfxRotate As XGraphics = XGraphics.FromPdfPage(page)
        gfxRotate.RotateAtTransform(90, New XPoint(20, 550))
        gfxRotate.DrawString("Text Here", SmallBoldFont, XBrushes.Black, New XPoint(20, 550))


Be sure to dispose any other graphics used prior.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 372 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