Create wide table in PDF with Colspan using Aspose.PDF for .NET - Incorrect Cell borders

@Adnan.Ahmad,
I have created two pdf (ExpectedPdfCreatedUsingAsposeExcel.pdf using Aspose.Excel and UnExpectedPdfCreatedUsingAsposeExcel.pdf using Aspose.Pdf).
I can see the difference for cell border in both pdf. Please have a look at attached PDF.

UnexpectedPdfCreatedUsingAsposePdf.pdf (47.4 KB)
ExpectedPdfCreatedUsingAsposeExcel.pdf (53.1 KB)

@dfactset,

Thanks for sharing files with us.

Hi @Adnan.Ahmad,

Any update on the above mentioned issue?

@dfactset,

We are looking into this issue again. I request for your patience.

Hi @adnanahmed

Any update on this issue?

@dfactset

We have again tested the scenario in our environment using Aspose.PDF for .NET 20.6 and obtained attached PDF document. Would you please check it and highlight the issues you see in it. Also, we have attached a screenshot in which we pointed towards the issues which we noticed as per our understandings. Please share your feedback with us so that we can further proceed to address all issues.

IncorrectColspanBorders.pdf (3.5 KB)
borderissues.png (69.4 KB)

@asad.ali

Thank you for looking into this issue. I verified the issue with the same reproducer mentioned above with Aspose.PDF for .NET 20.6 and 20.7 and it seems that the cell border is still incorrect.

@dfactset

We have logged another ticket as PDFNET-48525 in our issue tracking system to re-investigate the scenario. We will keep you informed about the progress towards resolution of this ticket. Please be patient and spare us some time.

We are sorry for the inconvenience.

@dfactset

We have initially investigated the ticket and found that we already had removed the borders when issue was logged under previously-logged ticket i.e. PDFNET-41625.

Please check the above screenshot which we had shared with you in order to verify the issues. We request you to please share a screenshot showing the difference between expected and generated results. It would really help us understand the issue and resolve it accordingly. We greatly appreciate your cooperation in this regard.

We are sorry for the trouble faced.

Hi @asad.ali

I am pointing out the issue in attached image.

borderissues_Return.png (70.4 KB)

I have already posted the expected and unexpected result in comment above. Please have a look on this and let me know if you have any concern.

@dfactset

Thanks for your response.

We did check the files which you had shared earlier. However, the content and table size is smaller in the file than in the image which is causing confusion in noticing the issue. We could only notice that the border width (between two rows) was thicker in the PDF generated by Aspose.PDF. Is it the issue that you are referring to?

Furthermore, in your shared image, we have noticed following:

  • in first row, only right border is missing
  • in 4th row, both right and left borders are missing
  • in 10th row, the border width is not correct

Please confirm if our understandings are correct about the actual issue that you are facing so that we can further proceed accordingly. We apologize for the confusion.

@asad.ali

As per my understanding 1st Row and 4th row are as expected.
Issue is in 10th row which are as follows -:

  1. left border should be missing like left border of 4th row.
  2. right border (of red color) width is not correct.

I am attaching an image where I have pointed out the issue with red circle.

borderissues.png (67.9 KB)

Please let me know if you have any concern.

@dfactset

Thanks for your cooperation.

We have noted the provided information and now will investigate to resolve the pointed issues. We will let you know in case we require more information from your side.

The issues you have found earlier (filed as PDFNET-48525) have been fixed in Aspose.PDF for .NET 20.8.

Thank you @asad.ali for looking into issue. I verified the issue with the reproducer mentioned at down with Aspose.PDF for .NET 20.8 and it seems that the cell border is still incorrect.

I am attaching the reproducer below along with the output pdf. Please have a look at this issue.

Here is the reproducer:

 static void wideTable()
        {
            Document doc = new Document();
            var page = doc.Pages.Add();
            page.PageInfo.Width = PageSize.PageLetter.Width;
            page.PageInfo.Height = PageSize.PageLetter.Height;
            page.PageInfo.Margin = new MarginInfo(27, 27, 27, 27);

            //Instantiate a table object that will be nested inside outerTable that will break
            //inside the same page
            var mytable = new Aspose.Pdf.Table();
            mytable.Broken = TableBroken.VerticalInSamePage;
            mytable.DefaultCellBorder = new BorderInfo(BorderSide.All);
            mytable.ColumnWidths = "160 160 160 160 160 160";
            page.Paragraphs.Add(mytable);

            //Add header Row
            var row = mytable.Rows.Add();
            row.Cells.Add("TextHeader Row 1 Column 1");
            row.Cells.Add("TextHeader Row 1 Column 2");
            row.Cells.Add("TextHeader Row 1 Column 3");
            row.Cells.Add("TextHeader Row 1 Column 4");
            row.Cells.Add("TextHeader Row 1 Column 5");
            row.Cells.Add("TextHeader Row 1 Column 6");


            //Create rows in the table and then cells in the rows 
            var row1 = mytable.Rows.Add();
            var cell = row1.Cells.Add("Row 2 Col 1");
            cell.ColSpan = 4;
            cell.BackgroundColor = Color.Red;
            row1.Cells.Add("Row 2 Col 5");
            row1.Cells.Add("Row 2 Col 6");

            var row2 = mytable.Rows.Add();
            cell = row2.Cells.Add("Row 3 Col 1");
            cell.ColSpan = 3;
            cell.BackgroundColor = Color.Green;
            row2.Cells.Add("Row 3 Col 4");
            row2.Cells.Add("Row 3 Col 5");
            row2.Cells.Add("Row 3 Col 6");

            var row3 = mytable.Rows.Add();
            row3.Cells.Add("Row 4 Col 1");
            row3.Cells.Add("Row 4 Col 2");
            row3.Cells.Add("Row 4 Col 3");
            row3.Cells.Add("Row 4 Col 4");
            row3.Cells.Add("Row 4 Col 5");
            row3.Cells.Add("Row 4 Col 6");

            doc.Save("wideTable.pdf");
        }

I am attaching an image also where I have pointed out the issue with red circle.

wideTable.pdf (35.7 KB)
wideTable.JPG (114.4 KB)

@dfactset

We have logged another ticket as PDFNET-48657 for the issue that you have mentioned. We will investigate it as well and let you know as soon as it is resolved. Please spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali

Any update on this issue?

@dfactset

We regret to inform that earlier logged issue is not yet resolved. We will surely investigate and fix it on a first come first serve basis and will inform you in this forum thread as soon as some definite progress is made towards its resolution. Please be patient and give us some time.

We apologize for your inconvenience.

Can I get an update?

@dfactset

We are afraid that the earlier logged ticket is not yet resolved due to other pending issues in the queue. Nevertheless, we have recorded your concerns and will surely inform you once we make some progress regarding issue fix. We apologize for the inconvenience.