Hi,
Hi Rajesh,
Thanks for contacting support.
I have tested the scenario using Aspose.Pdf for .NET 12.0.0 where I have used following code snippet based on new Document Object Model of Aspose.Pdf namespace and as per my observations, the output is properly being generated. For your reference, I have also attached the output generated over my end.
Document vPdf = new Document();
Page vSection = vPdf.Pages.Add();
Aspose.Pdf.Table vTable = new Aspose.Pdf.Table();
AddRow(vTable, Aspose.Pdf.BorderSide.Left);
AddRow(vTable, Aspose.Pdf.BorderSide.Left);
AddRow(vTable, Aspose.Pdf.BorderSide.Left);
AddRow(vTable, Aspose.Pdf.BorderSide.Top);
AddRow(vTable, Aspose.Pdf.BorderSide.Top);
AddRow(vTable, Aspose.Pdf.BorderSide.Top);
AddRow(vTable, Aspose.Pdf.BorderSide.Right);
AddRow(vTable, Aspose.Pdf.BorderSide.Right);
AddRow(vTable, Aspose.Pdf.BorderSide.Right);
AddRow(vTable, Aspose.Pdf.BorderSide.Bottom);
AddRow(vTable, Aspose.Pdf.BorderSide.Bottom);
AddRow(vTable, Aspose.Pdf.BorderSide.Bottom);
vSection.Paragraphs.Add(vTable);
vPdf.Pages.Add(vSection);
vPdf.Save("c:/pdftest/Cell_Border_Issue.pdf");
private Document Example2()
{
Document vPdf = new Document();
Page vSection = vPdf.Pages.Add();
Aspose.Pdf.Table vTable = new Aspose.Pdf.Table();
AddRow(vTable, Aspose.Pdf.BorderSide.Bottom);
AddRow(vTable, null);
vSection.Paragraphs.Add(vTable);
vPdf.Pages.Add(vSection);
return vPdf;
}
private void AddRow(Aspose.Pdf.Table pTable, Aspose.Pdf.BorderSide? pBorderSide)
{
Aspose.Pdf.Row vRow = pTable.Rows.Add();
Aspose.Pdf.Cell vCell = vRow.Cells.Add();
vCell.Paragraphs.Add(new Aspose.Pdf.Text.TextFragment(pTable.Rows.Count.ToString()));
if (pBorderSide != null)
{
vCell.Border = new Aspose.Pdf.BorderInfo(pBorderSide.Value, 1, Aspose.Pdf.Color.Blue);
}
}
Thank you for your response.
rsharma:1. Setting the cell border to All creates a thick border between two adjacent cells because of the Right and Left borders for two horizontally adjacent cells or the Bottom and Top for two vertically adjacent cells.Hi Rajesh,Thanks for sharing the updates.In order to control the border, you can specify the side of cell border which you need to render. Please take a look over following code line.pTable.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.Left
| Aspose.Pdf.BorderSide.Right, Aspose.Pdf.Color.Brown);I am afraid currently Aspose.Pdf namespace does not support this feature. However for the sake of implementation, we already have logged it as PDFNEWNET-38548 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.rsharma:2. The Table class used to provide a method SetColumnWidth where you can set the width of a single column and the rest were auto-calculated. What is the equivalent in the Aspose.Pdf namespace? I only see ColumnWidths which seems to require all columns be specified.
We are having many problems trying to switch the new DOM. The behavior of the new DOM is different and does not seem to work as one would expect. Here is an example of the old and new having a table with two rows and an image in each cell. The old Generator version correctly breaks to the next page and the new version shrinks the second image to fit on the same page. I have tried many combinations of table/row breaking properties with no luck. The only way I can get the second row on the next page is to set vRow2.IsInNewPage = true; which is not a practical solution because this should be handled internally like the Generator does.
Hi Rajesh,
The issues you have found earlier (filed as PDFNET-41553) have been fixed in Aspose.Pdf for .NET 16.11.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi Rajesh,
Thanks for your patience.
We are pleased to share that the issue reported earlier is resolved and its fix will be included in next release of Aspose.Pdf for .NET 17.3.0. Furthermore, in order to generate correct output, please try using following code snippet.
[C#]
Table table = new Table();
table.ColumnAdjustment = ColumnAdjustment.AutoFitToContent;
Row row = table.Rows.Add();
Cell cell = row.Cells.Add("Cell 1 text");
cell = row.Cells.Add("Cell 2 text");
table.GetWidth();
Assert.IsTrue(cell.Width == 44.47);
The issues you have found earlier (filed as PDFNET-38548) have been fixed in Aspose.Pdf for .NET 17.3.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(7)