We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to determine width of plotted text- part 2

In addition to this (closed) topic.

In version the text.GetLength(Pdf doc) function was working fine.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Today I downloaded versions and 4.1.1. In both these versions the text.GetLength(Pdf doc) function seems to be missing. I expected it to be a Public Instance Method of the Text class. http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/aspose.pdf.textmembers.html

The property Text.TextWidth seems not to be the same as the GetLength function.

Where is the GetLength function?

What is the difference between the GetLength function and the TextWidth property?

Best regards, Arjen.

Hello Arjen,

Thanks for considering Aspose.

Text.GetLength() method is obsolete and is not available in latest version. We apologize for your inconvenience.

TextWidth property returns the width of the text paragraph.

Hello Nayyer,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The function is now obsolete? That is a pity...

Could you tell me why?

Is there another solution to determine the textwidth?

My program is a C# program and to create a printout I use Aspose PDF. The document contains a lot of table-like pages, but each with a variable number of lines and different page layout.

I tried to format the document with tables, but generating a printout based on TABs appeared to be much faster. The only disadvantage of TABs is that long strings will pass TAB positions. To solve this problem I created a function that splits the string into smaller strings and if there a multiple substrings the output continues on the next line at the right TAB position. But to be able to split the string at the right position I need to be able to determine the width of each substring. That’s why I would appreciate the GetLength() function…

Could you please consider to make this function available again?

Best regards,


Hi Arjen,

That function is obsolete because of low performance. You can use Pdf.GetStringWidth() instead.