Welcome Guest Search | Active Topics | Sign In | Register

How to know text width in PdfTextContent with conrete font? Options
Andrew Usikov
Posted: Sunday, February 19, 2012 10:06:04 AM
Rank: Newbie
Groups: Member

Joined: 2/19/2012
Posts: 4
Hi!) Please, answer me.
i have some text( "Bla bla bla bla") in PdfTextContent,
i use font as ("Lucida Console",Size = 8)

how to know width of this text, which already is rendered in the pdf document?

Thanks!

eo_support
Posted: Sunday, February 19, 2012 11:46:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

No. There is no way to get the size from PdfTextContent. You can only get the text if you use HTML to PDF:

http://www.essentialobjects.com/doc/4/eo.pdf.htmlelement.size.aspx

You would run HTML to PDF to get an HtmlToPdfResult object, from that object you can get the HtmlElement object. You can then get the element's size.

Thanks!
Andrew Usikov
Posted: Sunday, February 19, 2012 12:46:28 PM
Rank: Newbie
Groups: Member

Joined: 2/19/2012
Posts: 4
HI,

This solution has no wanted results.
What you think about this:
can i use System.Windows.Forms.TextRenderer.MeasureText() method for calculating text width, which already is rendered in the pdf document?

Thanks!
eo_support
Posted: Sunday, February 19, 2012 8:37:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No. Using HtmlElement.Size property is the only way for you to get text size.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.