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

Free Support Forum - aspose.com

Missing border for cells when more than one page

Hi Aspose

I discovered a problem with borders for a cell in a table within another table.

When section can be in one page, it seems to be ok, but when more than one page is needed borders is droped !

See example code below.

Regards, Martti

Dim tablePDF As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf
tablePDF.IsBuffered = False
Dim mySection As Aspose.Pdf.Section = New Aspose.Pdf.Section()
tablePDF.Sections.Add(mySection)
mySection.IsLandscape = False
mySection.IsNewPage = True
mySection.PageInfo.PageHeight = PageSize.A4Height
mySection.PageInfo.PageWidth = PageSize.A4Width

Dim myText As Aspose.Pdf.Text = New Aspose.Pdf.Text(mySection, "Cell with border")
mySection.Paragraphs.Add(myText)

Dim iTable As Table = New Table()
mySection.Paragraphs.Add(iTable)
For ix As Integer = 0 To 49 '49 do not work(border is missing at first page), 48 is OK
Dim iRow As Row = New Row(iTable)
iTable.Rows.Add(iRow)
Dim iCell As Cell = New Cell(iRow)
iRow.Cells.Add(iCell)
'*******************************************
'Create table
Dim newTable As Table
newTable = New Table(iCell)
iCell.Paragraphs.Add(newTable)
newTable.ColumnWidths = "12.2 12.2 12.2"
Dim newRow As Row = New Row(newTable)
newRow.FixedRowHeight = 11.35F
'create cell's
Dim newCell1 As Cell = New Cell(newRow)
Dim tomCell1 As Cell = New Cell(newRow)
Dim newCell2 As Cell = New Cell(newRow)
'add text to cell
newCell1.Border = New Aspose.Pdf.BorderInfo(BorderSide.All, 0.5F)
Dim newText1 As Aspose.Pdf.Text = New Aspose.Pdf.Text("")
newCell1.Paragraphs.Add(newText1)
newCell2.Border = New Aspose.Pdf.BorderInfo(BorderSide.All, 0.5F)
Dim newText2 As Aspose.Pdf.Text = New Aspose.Pdf.Text("")
newCell2.Paragraphs.Add(newText2)
'Add cell to row
newRow.Cells.Add(newCell1)
newRow.Cells.Add(tomCell1)
newRow.Cells.Add(newCell2)
newTable.Rows.Add(newRow)
'*******************************************
Dim iRow2 As Row = New Row(iTable)
iTable.Rows.Add(iRow2)
Dim iCell2 As Cell = New Cell(iRow2)
iRow2.Cells.Add(iCell2)
Next

tablePDF.Save("C:\Temp\TableTest.pdf")
MsgBox("Finish")

Hello Martti,

Thanks for considering Aspose.

I have tested the issue and have noticed that, the border drop issue occurs only, when cells with blank contents are being added to the table. As a workaround, if you replace the code lines with one of the following, you will notice that the border appears, on multiple pages.

[VB.NET]

newCell1.Border = New Aspose.Pdf.BorderInfo(BorderSide.All, 0.5F)
Dim newText1 As Aspose.Pdf.Text = New Aspose.Pdf.Text("Left ")
newCell1.Paragraphs.Add(newText1)

We are looking into details of this matter and will keep you updated with the status of correction. We apologize for your inconvenience.

Hi mWienke,

I can reproduce the problem, It is logged as PDFNET-6538, I think I can fix this problem in about two weeks.

Thanks.