I am using PDFsharp (http://www.pdfsharp.net/) to draw a string to a PDF file. I want the text to be placed at position (0,0) but when it is rendered to the PDF, the X position is at 0, but the top of the text is offset down. I think this is due to the line height of the font because when I highlight the text I can see that the highlight extends beyond the top and bottom. How can I get PDFsharp to position the text without the padding at the top so the top of the text is sitting right on the edge of the label?
This is a snippet of the code that I am using for drawing the text:
XFont font = new XFont(text.Font,
XUnit.FromMillimeter(text.Height), XFontStyle.Regular);
gfx.DrawString(text.Content, font, textLayer,
new XPoint(XUnit.FromMillimeter(0), XUnit.FromMillimeter(0)),
XStringFormats.TopLeft);