Can I flip the coordinate system without flipping text in iTextSharp?
- by I. J. Kennedy
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?