PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Jul 18, 2024 9:19 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Inverted text
PostPosted: Thu Jan 19, 2012 4:09 pm 
Offline

Joined: Thu Jan 19, 2012 2:37 pm
Posts: 1
Hi,
I'm trying to use PDFSharp to add 2 text strings to a document - one as normal and 1 upside-down.

To cut a long question short:
I can add the normal text ok. How do I add the inverted text?

This is the code I'm using to add the normal text:

PdfDocument doc = PdfReader.Open(_path, PdfDocumentOpenMode.Modify);
PdfPage pdfPage = doc.Pages[0];
XGraphics gfx = XGraphics.FromPdfPage(pdfPage);
//
XTextFormatter tf = new XTextFormatter(gfx);
XFont fontHeader = new XFont("Arial", 24, XFontStyle.Bold);
//
XRect topRect = new XRect(200, 0, 200, 100);
tf.Alignment = XParagraphAlignment.Center;
tf.DrawString(_reference, fontHeader, XBrushes.Black, topRect, XStringFormats.TopLeft);
//
doc.Save(_path);
doc.Close();
doc=null;


Thanks for all help :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Inverted text
PostPosted: Fri Jan 20, 2012 12:59 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 343
Hi!
You'll have to use transformation, presumably RotateTransform.

See this thread for an example:
viewtopic.php?p=5413#p5413

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


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

All times are UTC


Who is online

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