PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Inverted text
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1888
Page 1 of 1

Author:  bukko [ Thu Jan 19, 2012 4:09 pm ]
Post subject:  Inverted text

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 :)

Author:  () => true [ Fri Jan 20, 2012 12:59 pm ]
Post subject:  Re: Inverted text

Hi!
You'll have to use transformation, presumably RotateTransform.

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/