Can I flip the coordinate system without flipping text in iTextSharp?
Posted
by I. J. Kennedy
on Stack Overflow
See other posts from Stack Overflow
or by I. J. Kennedy
Published on 2010-05-26T23:28:32Z
Indexed on
2010/05/26
23:31 UTC
Read the original article
Hit count: 361
I have some chart-creating code written for a coordinate system in which a y-coordinate of 0 is the top of the page. We are now converting to iTextSharp, which uses the conventional system from mathematics where a y-coordinate of 0 is the bottom of the page. There are many calculations involved in producing the chart and I'd like to not mess with those calculations. I can partially "fix" the problem by transforming iTextSharp's coordinate system like this:
pdfContentByte.ConcatCTM(1f, 0f, 0f, -1f, 0f, pdfDoc.PageSize.Height);
This works great for lines, rectangles, and circles, but the text is now upside down! Is there a way to remedy this, using SetTextMatrix
or otherwise?
© Stack Overflow or respective owner