We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDFLogicDocument measure string width

Thread ID:

Created:

Updated:

Platform:

Replies:

50858 Oct 20,2006 04:52 PM UTC Jan 9,2007 01:17 PM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: PDF
Jeff
Asked On October 20, 2006 04:52 PM UTC

I am using the PDFLogicDocument instead of the PDFDocument and don't see how to get the width of a string. When using the PDFDocument I use the following: pdfDoc.Graphics.MeasureString("Text", _boldFont).Width;

My problem is that I am trying to size the columns of a table so that the text does not wrap. And I have done this by keeping track of the longest string width for each column and setting the size to that.

Is there a better way to do this and if not, how do I get the length of a string that I'm adding to a paragraph when using the PDFLogicDocument.

Thanks,

Jeff


Dhivya K [Syncfusion]
Replied On October 23, 2006 12:57 PM UTC

Hi Jeff,

Currently we do not have support for this feature in flow model. Sorry for the inconvenience. However, I will consult with development team regarding this feature and send you an update as soon as I hear back.

Regards,
Dhivya.

Chris Fraschetti
Replied On January 8, 2007 10:35 PM UTC

Has there been any progress adding this functionality to the flow model?

Any text that I add to my table which either is set not to wrap and is too long for the cell width causes serious rendering issues. I would like to be able to either have the string properly cropped or a method to determine if the string will fit so that I can manually crop it myself.

Dhivya K [Syncfusion]
Replied On January 9, 2007 01:17 PM UTC

Hi Chris,

We do have option to truncate/wrap the text according to the width of the cell in flow model using TextWrap property.

This API is implemented in 4.4 version onwards.

To supress text wrapping at table level that is to suppress for whole table use the following code

table.TableFormat.TextWrap = false;

and to suppress text wrapping at cell level use the following code

table[1,0].CellFormat.TextWrap = false;

Here is a sample for your reference:
http://www.syncfusion.com/Support/user/uploads/Textwrap_18d862da.zip

Please take a look into the sample and let me know if it meets your requirement.

Regards,
Dhivya.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;