Hello,
I'm generating a PDF file programmatically. The simplest I can get this error is one A4 page with text and tables embedded in each other (one main table and 3 embedded in it's cells).
When I generate the inner tables with one empty row (no cells added) then the generated PDF is invalid. Exactly: it can be opened but Adobe Acrobat XI shows this error message after printing:
"An error exists on this page. Acrobat may not display the page correctly. ..." [1] The printed output seems ok.
When I add an empty cell into the empty row, the error is fixed. It seems the previous version of DynamicPdf we used (3.0.3) didn't suffer with this problem, but I cannot confirm this as it's rather aged library.
Is any fix available from you or must I use the workaround with an empty cell? Is some cell mandatory in a table row?
Thanks, Peter I.
[1] https://forums.adobe.com/thread/1156093?tstart=0
Empty table row breaks PDF
Re: Empty table row breaks PDF
Support · Nov 20, 2014Hello,
We did testing on our end by adding a table and inner table (nested) with an empty row, we are able to open and view the generated PDF in Adobe Reader without any problem. Below is the code sample used to generate the PDF with table and nested table having an empty row.
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Table2 maintable = new Table2(0, 0, 500, 600);
//Adding columnn to the table
maintable.Columns.Add(400);
maintable.Columns.Add(100);
maintable.Columns.Add(100);
//Adding empty row to the main table.
Row2 row1 = maintable.Rows.Add(40);
//Building inner table to add into the cell of main table.
Table2 innerTable = new Table2(0, 0, 400, 200);
innerTable.Columns.Add(196);
innerTable.Columns.Add(196);
//creating and adding empty row to the inner table.
Row2 innerTableEmptyRow1 = innerTable.Rows.Add(40);
//creating and adding first row to the inner table.
Row2 innerTableRow2 = innerTable.Rows.Add(30);
Cell2 innerTableRow2Cell1 = innerTableRow2.Cells.Add("inner table item1");
Cell2 innerTableRow2Cell2 = innerTableRow2.Cells.Add("inner table item2");
//creating and adding second row to the inner table.
Row2 innerTableRow3 = innerTable.Rows.Add(30);
innerTableRow3.Cells.Add("inner table item3");
innerTableRow3.Cells.Add("inner table item4");
//Setting height fo the inner table.
innerTable.Height = innerTable.GetRequiredHeight();
//Adding second row to main table
Row2 row2 = maintable.Rows.Add(30);
//Adding inner table to the main table.
row2.Cells.Add(innerTable);
row2.Cells.Add("Main table Item ");
row2.Cells.Add("Main table Item ");
row2.Height = innerTable.Height;
//Adding third row to main table
Row2 row3 = maintable.Rows.Add(30);
row3.Cells.Add("Main table item ");
row3.Cells.Add("Main table item ");
row3.Cells.Add("Main table item ");
//Add main table to page.
page.Elements.Add(maintable);
//Save the PDF.
document.Draw(@"C:\Temp\MyDocument.pdf");
It is suggested to use the very latest DynamicPDF product DLL files in your application and see if it works for you. You can download the latest product by logging into our CustomerArea
using your DynamicPDF product serial number. Remove reference for the older DLL file and reference the latest in your application.
If you are evaluating the product then you can download the very latest DynamicPDF product from our website here
.
If you continue getting the similar behavior even after using the latest DLL file then please send over the following details to [^a|mailto:support@cete.com|opennewwindow|support@cete.com^] so that we can look into it further.
1.Sample code which uses static data using which we can recreate the behavior.
2.Output PDF.
3.Exact version and build number of the DynamicPDF DLL file. You can get this information in DLL references properties (Version and Descriptions fields) in Visual Studio.
Thanks,
ceTe Software Support Team.