I am attempting to Span a Cell over 2 rows and I can do it without issue if the cell is not on the first row of the table, but as soon as I set RowSpan = 2 on a cell in the first row an exception is thrown in the Save Method. This code is copied from a response on this forum regarding RowSpan that I have altered to to provide an example:
Hi Jon,
Thanks for your inquiry. I've managed to reproduce the issue at my end and logged it as PDFNEWNET-35211 in our bug tracking system for further investigation and resolution. You will be notified via this thread as soon as it is resolved.
Sorry for the inconvenience faced.
<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Best Regards,
Hi Jon,
Document doc = new
Document();<o:p></o:p>
Page page = doc.Pages.Add();
page.PageInfo.Height = 711f + 9f + 9f;
page.PageInfo.Width = 468f + 9f;
page.PageInfo.Margin = new Aspose.Pdf.MarginInfo();
page.PageInfo.Margin.Bottom = 0;
page.PageInfo.Margin.Left = 0;
page.PageInfo.Margin.Right = 0;
page.PageInfo.Margin.Top = 0;
Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();
//Add the table in paragraphs collection of the desired page
page.Paragraphs.Add(tab1);
//Set with column widths of the table
tab1.ColumnWidths = "120 120 120";
//Set default cell border using BorderInfo object
tab1.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 0.1F, Aspose.Pdf.Color.Red);
//Set table border using another customized BorderInfo object
tab1.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, 1F, Aspose.Pdf.Color.Blue);
//Create MarginInfo object and set its left, bottom, right and top margins
Aspose.Pdf.MarginInfo margin = new Aspose.Pdf.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;
Aspose.Pdf.Row row1 = tab1.Rows.Add();
Aspose.Pdf.Cell cell1 = new Aspose.Pdf.Cell();
cell1.Paragraphs.Add(new TextFragment("Column 1"));
row1.Cells.Add(cell1);
//Create rows in the table and then cells in the rows
row1.Cells.Add("col2");
row1.Cells.Add("Should span 2 Rows");
row1.Cells[2].RowSpan = 2;
Aspose.Pdf.Row row2 = tab1.Rows.Add();
row2.Cells.Add("item1");
row2.Cells.Add("item2");
// row2.Cells.Add("item3");
Aspose.Pdf.Row row3 = tab1.Rows.Add();
// set the default cell border for row as None
row3.DefaultCellBorder = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.None);
row3.Cells.Add("item1");
row3.Cells[0].IsNoBorder = true; //Set the border for cell0 as None
row3.Cells.Add("item2");
row3.Cells.Add("item3");
row3.Cells[2].IsNoBorder = true; //Set the border for cell2 as None
row3.Cells[2].RowSpan = 2;
Aspose.Pdf.Row row4 = tab1.Rows.Add();
row4.Cells.Add("item1");
row4.Cells.Add("item2");
doc.Save(“c:/pdftest/RowSpanIssue.pdf”);
The issues you have found earlier (filed as PDFNEWNET-35211) have been fixed in Aspose.Pdf for .NET 8.1.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.