can't get length of symbol string in points

G

Guest

Hello,

I am workin' on creating web from as pdf file.



My pdf file size is 595 x 820 points. Can anybody tell how can I count the
length of my string in points?

string x;
int y;
y = x.Length; // gives me length in symbols, but I need string length in
points. Can anybody help with this?

Thank you ;)
 
M

Michael Nemtsev, MVP

Hello HiperiX,

to get the length in pixel u need to know the font which will be used in
rendering your text.
I general the the Graphics.MeasureString method do it

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


H> Hello,
H>
H> I am workin' on creating web from as pdf file.
H>
H> My pdf file size is 595 x 820 points. Can anybody tell how can I
H> count the length of my string in points?
H>
H> string x;
H> int y;
H> y = x.Length; // gives me length in symbols, but I need string length
H> in
H> points. Can anybody help with this?
H> Thank you ;)
H>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top