I’ve managed to isolate the cause and have a complete block of code to illustrate it.
Run the following code with v4.1.2 of Aspose.PDF DLL and it works fine. The text is on one line.
Run it again with v6.9 and it wraps on to two lines. It seems the issue is with the DefaultCellPadding. It’s set to 4. On both versions of the DLL it says “the unit is point”, so it should be treated the same, but it isn’t.
Any advice (that doesn’t require us to manually change all of the hundreds of padding values in our code)?
// prepare our document , section and table
Pdf pdf1 = new Pdf();
Section sec1 = pdf1.Sections.Add();
Aspose.Pdf.Table invTable = new Aspose.Pdf.Table();
//set up a TextInfo class for use on our cell
TextInfo ti = new TextInfo();
ti.FontName = “Arial”;
ti.FontSize = 10;
ti.IsTrueTypeFontBold = true;
//prepeare a border to illustrate edges of cell
BorderInfo brdr = new BorderInfo((int)BorderSide.All, 0.5F, new Color("#000000"));
invTable.DefaultCellBorder = brdr;
// set the default padding for the table
invTable.DefaultCellPadding.Left = 4;
invTable.DefaultCellPadding.Right = 4;
invTable.DefaultCellBorder = brdr;
//add a row
Row headerRow = invTable.Rows.Add();
//add a cell
headerRow.Cells.Add(“Qty”, ti);
//set the column width
invTable.ColumnWidths = “24.66”;
//add the table to the section
sec1.Paragraphs.Add(invTable);
//show response (pdf file output) to user on the web page
HttpResponse response = Response;
response.Expires = 0;
response.Buffer = true;
response.ClearContent();
response.AddHeader(“content-disposition”, “inline; filename=” + “output.pdf”);
response.ContentType = “application/pdf”;
response.BinaryWrite(pdf1.GetBuffer());
response.End();