The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
DKDhivya K Syncfusion Team 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.
CFChris FraschettiJanuary 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.
DKDhivya K Syncfusion Team 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.