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

Free Support Forum - aspose.com

Odd behaviour of tables at page breaks

Hello,

we recently noticed that tables do not always behave correctly on page breaks.

Sometimes parts of the content that should be on the next page are rendered over the page’s bottom margin (and sometimes even out of the page bounds) and there’s a blank space on the next page where content should have been.

Sometimes there’s an extra blank row just before the page break.

On most of those cases there’s no cell padding at the top of the second part of the table.

We have been able to reproduce the problem using a slightly modified version of the example given on this page: Set Border Style, Margins and Padding of the Table - Aspose.Pdf for .NET

The code for the test console application is at the end of this post.
We used:

  • Visual Studio 2008
  • .Net Framework 3.5
  • Aspose.PDF 6.0.0.0 for .Net 3.5
  • Windows 7 Professional
By changing the width of the second column we were able to produce several of the scenarios described above. Attached you find the resulting PDF after setting the width of the second column to 33%. Please note the break from page 5 to page 6.
Another “interesting” value for the width of the second column is 42%.

Can there anything be done about that behaviour?

Thanks,

Frank




using System;
using Aspose.Pdf.Generator;

namespace AsposePdfPageBreakSample
{
class Program
{
static void Main(string[] args)
{
//Instntiate the Pdf object by calling its empty constructor
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();

//Create the section in the Pdf object
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

//Instantiate a table object
Aspose.Pdf.Generator.Table tab1 = new Aspose.Pdf.Generator.Table();

//Add the table in paragraphs collection of the desired section
sec1.Paragraphs.Add(tab1);

//Set with column widths of the table
tab1.ColumnWidths = “20% 33% 20%”;

//Set default cell border using BorderInfo object
tab1.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F);

//Set table border using another customized BorderInfo object
tab1.Border = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 1F);

//Create MarginInfo object and set its left, bottom, right and top margins
Aspose.Pdf.Generator.MarginInfo margin = new Aspose.Pdf.Generator.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;

//Create rows in the table and then cells in the rows
for (int i = 0; i < 20; i++)
{
Aspose.Pdf.Generator.Row row1 = tab1.Rows.Add();
row1.Cells.Add(“col1”);
row1.Cells.Add(“sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.”);
row1.Cells.Add(“col3”);
}

//Save the Pdf
pdf1.Save(“d:/pdf-temp/TableResult.pdf”);
}
}
}

Hello Frank,

Thanks for using our products.<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

I
have tested the scenarios and I am able to reproduce both problems. For the
sake of correction, I have logged them in our issue tracking system as <span style=“font-family:“Arial”,“sans-serif””>PDFNEWNET-29636. We will
investigate these issues in details and will keep you updated on the status of a
correction.<span style=“font-size: 10pt; font-family: “Arial”,“sans-serif”;”>

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA”>We apologize for your inconvenience.

Hello Nayyer,



thank you for the quick reply.

I have just been made aware that our subscription expires on August 13, 2011.

Will we still be able to access the fix for the problem?

Since the subscription is solely for that one project and the current
version of the component covers all our needs (apart from the mentioned
problem) there are currently no plans to renew it.


Thanks,

Frank

Hello Frank,

As far as I can see the current issue status, its still marked as unresolved. I am not entirely certain about the time-frame by which its hotfix becomes available. Please note that if the hotfix becomes available after your subscription’s expiry date, I am afraid you might not be able to use your current license with that versions. Probably you will have to renew your subscription.

Meanwhile I have also requested the development team to share the ETA for this issue. Please be patient and spare us little time. We apologize for your inconvenience.

Hello again,

we renewed our subscription, so we won’t have any problems with that.
Any news on the ETA for the hotfix? We’d like to give our customers at least a rough estimate on the timeframe.

Thanks,

Frank

Hello Frank,

Thanks for your patience. I am afraid the issue is still not resolved and currently I don not have any information regarding its ETA. However, I have sent an intimation to the development team to share the rough estimates by which this issue will be fixed. Please spare us little time. We are sorry for the delay and inconvenience.

Hi there,



it’s been a while now. Are there any news on the issue? Or is there a public access to your issue tracking system, so we can check on our own?

Hello Frank,

Thanks for your patience. I am pleased to share that the issue reported earlier has been fixed and its hotfix will be included in upcoming release version of Aspose.Pdf for .NET, which is expected to be released by first week of October2011. Please be patient and wait for the new release. For your reference, I have attached the resultant PDF that I have generated.

Hello,
that’s good to hear. The pdf is looking really good now. We’re looking forward to the release.

Thanks again,
Frank

Will this resolve basically the same issue (set of issues) in Aspose pdf for Reporting Services? My assumption is that the reporting services dll is authored or related by/to the pdf.Net

Hi Jeff,

The issue reported in this thread is related to Aspose.Pdf for .NET and the new version will contain its resolution. Yes you are correct. Aspose.Pdf for Reporting Services is based on Aspose.Pdf for .NET, so the correction of issues in this product will definitely impact on Aspose.Pdf for Reporting Services. In case you have any further query, please feel free to contact.

The issues you have found earlier (filed as 29636 ) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Dear Nayyer,

we just tested the 6.3.0.0 release and still see some issues regarding the page breaks.

Using the same project as mentioned in my first post with the width of the middle column set to 33%, the break from page 5 to page 6 is now working correctly. But in the cells of the first line on page 6 there is no padding between the top border and the content.

Now set the width of the middle coloumn to 42%. At the end of page 6 the content of the middle column is completely pushed to page 7 while the content of the left and the right column is still shown on page 6. We would have expected to see the first line of the middle column’s text being displayed on page 6, too.

In our actual project that is a major problem to us.

Would you please have a look into this?

Frank

Hello Frank,

Thanks for sharing the feedback. I have been able to notice the top margin issue for contents on page6 and I have also managed to reproduce the issue where content of the middle column is completely pushed to page (while setting the width of middle column to 42%) . For the sake of correction, I have re-opened already reported issue. Soon you will be updated with the status of correction. We are sorry for this inconvenience.

The issues you have found earlier (filed as PDFNEWNET-29636) have been fixed in Aspose.Pdf for .NET 9.5.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Frank,


Thanks for your inquiry. We are pleased to inform you that your reported issue has been fixed in new DOM approach of table creation. Please check following code snippet for the purpose. Please download and try latest version for Aspose.Pdf for .NET, it will help you to accomplish the problem.

string outFile = “29636.pdf”;<o:p></o:p>

// Added document

Document doc = new Document();

Page page = doc.Pages.Add();

Aspose.Pdf.Table tab1 = new Aspose.Pdf.Table();

//Add the table in paragraphs collection of the desired section

page.Paragraphs.Add(tab1);

//Set with column widths of the table

tab1.ColumnWidths = "20% 33% 20%";

//Set default cell border using BorderInfo object

tab1.DefaultCellBorder = new BorderInfo(BorderSide.All, 0.1F);

//Set table border using another customized BorderInfo object

tab1.Border = new BorderInfo(BorderSide.All, 1F);

//Create MarginInfo object and set its left, bottom, right and top margins

MarginInfo margin = new 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;

//Create rows in the table and then cells in the rows

for (int i = 0; i < 20; i++)

{ Row row1 = tab1.Rows.Add(); row1.IsRowBroken = true; row1.Cells.Add("col1").VerticalAlignment = VerticalAlignment.Top; row1.Cells.Add("sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."); row1.Cells.Add("col3").VerticalAlignment = VerticalAlignment.Top; }

//Save the Pdf

doc.Save(outFile);

Please feel free to contact us for any further assistance.


Best Regards,