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

MeasureString with XSize method
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1061
Page 1 of 1

Author:  drbigbyte [ Thu Feb 18, 2010 3:52 pm ]
Post subject:  MeasureString with XSize method

Hello All,

I have a need to use the MeasureString with a XSize area. I have some dynamic data that needs to printing in a rectangle. I am using the normal Graphics.MeasureString(string, font, SizeF(width, height)) that works great.

Now I need to use the same code under PdfSharp and this Method is missing. Has anyone worked around this issue yet?

Thank you Advance!

Author:  dancer [ Thu Feb 18, 2010 4:10 pm ]
Post subject:  Re: MeasureString with XSize method

This is working for me:


Code:
XGraphics gfx = XGraphics.FromPdfPage(pdfPage);
XFont font = new XFont("Verdana", 20 / koef, XFontStyle.BoldItalic);
XSize size = gfx.MeasureString("Hello World", font);


Hope it will help you

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