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

Free Support Forum - aspose.com

Table.ColumnWidths not working with Dutch Regional settings

We noticed the setting of the table property ColumnWidths does not render/scale the columns correctly if your pc is set to dutch regional settings

We created a columnwidth string in a piece of c# code by using the float.ToString() method

kind regards

Robbert,

Hello Robert,

Sorry for replying you late.

I have tested the scenario using the following code snippet and I am unable to reproduce the problem. I have set my regional language settings to Duth (Netherlands) and also have set it for non-Unicode programs. Please suggest me if I am missing any thing. The resultant file is in attachment.

[C#]

//Create pdf document
Pdf pdf1 = new Pdf();
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();

//Instantiate a table object
Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();
//Add the table in paragraphs collection of the desired section
sec1.Paragraphs.Add(tab1);
//Set with column widths of the table
tab1.ColumnWidths = "150 50 50";
//Set default cell border using BorderInfo object
tab1.DefaultCellBorder = new BorderInfo((int)BorderSide.All, 0.1F);
//Set table border using another customized BorderInfo object
tab1.Border = new BorderInfo((int)BorderSide.All, 1F);
//Create MarginInfo object and set its left, bottom, right and top margins
MarginInfo margin = new MarginInfo();
margin.Top = 5f;
margin.Left = 5f;
margin.Right = 5f;|
margin.Bottom = 5f;
//Set the default cell padding to the MarginInfo object
tab1.DefaultCellPadding = margin;

//Create rows in the table and then cells in the rows
Aspose.Pdf.Row row1 = tab1.Rows.Add();
row1.Cells.Add("col1");
row1.Cells.Add("col2");
row1.Cells.Add("col3");

Aspose.Pdf.Row row2 = tab1.Rows.Add();
row2.Cells.Add("item1");
row2.Cells.Add("item2");
row2.Cells.Add("item3");

// save the Pdf document
pdf1.Save(@"c:\pdftest\Dutch_ColumnWidth.pdf");

Please share the code snippet that you are using, so that we can test the issue at our end.

thanks for the reply

of course the key issue with regional settings is usually in the notation

try something like

float f1 = 150.456;
float f2 = 30.543;
float f4 = 50.23667;
And use the ToString() method as I mentioned.

tab1.ColumnWidths = f1.ToString() + " " + f2.ToString() + " " + f3.ToString()

A code snippet of the actual code is going to be a little hard, you see it is part of an autoscaling routine I built, and it resizes the font size and calculates the neccesary space for each column so depending on what the user wants to display in the table you get different results.

btw my name is spelled with two B's ;-)

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

Sorry for misspelling your name in my previous reply and I hope this time I am writing the correct one.

I have tested the issue and I’m able to reproduce the same problem. I have logged it in our issue tracking system as PDFNET-6368. We will investigate this issue in detail and will keep you updated on the status of a correction. We apologize for your inconvenience.

Dear Robbert,

I have tested Nayyer’s codes with our latest dll and I am unable to reproduce the error. Please try the attached dll before our next release. Thanks.

Best regards.

thanks for the quick reponse and solution very impressive

The issues you have found earlier (filed as 6368) have been fixed in this update.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan