PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Jul 13, 2024 8:43 pm

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
PostPosted: Tue Sep 27, 2011 8:53 pm 
Offline

Joined: Tue Sep 27, 2011 8:37 pm
Posts: 4
Hi,
I need to place text vertically into my pdf document.
This document is one big image that I create on the fly and save as pdf.

I am using DrawText method, but it does not let me control orientation.
Could you please help.

Thank you in advance for your response.

Helen.


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 28, 2011 7:13 am 
Offline
PDFsharp Guru
User avatar

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

Look at the "DrawImage (rotated)" section of this sample:
http://www.pdfsharp.net/wiki/Graphics-sample.ashx

With "RotateTransform" you can draw rotated text.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 30, 2011 4:19 pm 
Offline

Joined: Tue Sep 27, 2011 8:37 pm
Posts: 4
Hi Thomas,

The sample code you quoted shows how to rotate an image, but I need to rotate text.
Is there a way to create image out of text?

Thanks
Helen.


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 01, 2011 3:02 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
hgoussarova wrote:
The sample code you quoted shows how to rotate an image, but I need to rotate text.
Transformations of the gfx apply to anything that is drawn (images and text).

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 02, 2011 3:02 am 
Offline

Joined: Tue Sep 27, 2011 8:37 pm
Posts: 4
I am very new to graphics programming. this is my first graphical project. so could you please help me a bit.

I have this main gfx where I add all my graphical elements to.
Now, I will create another gfx with the line of text I need to rotate. I will rotate it using the techinque you mentioned.
But how do I add this new gfx to a particular place in my main gfx?

Thank you in advance for your help.
Helen.


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 02, 2011 8:56 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
You only need one gfx.
You can call gfx.Save() before the transformation and gfx.Restore() after drawing the vertical text - the sample uses these functions in BeginBox/EndBox.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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: No registered users and 70 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