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

Free Support Forum - aspose.com

Table over several pages with inner and outer margin

Hi!


We are using Aspose to generate a table that stretches over several pages and should take up the whole “text width” (i.e. width of the page minus the margins). In the document (section), we are setting up the margins using inner and outer margins instead of left and right.
The table is positioned correctly on the odd pages (left margin is bigger), but it is not starting at the left margin on even pages (see attached pdf). Is there a possibility to align the table properly with the margin, or do we have to start a new table for every page? If we have to do add a table per page, is there a way to figure out where the new page should start?

Code looks as follows:
// Setting up margins
Buch = new Pdf();
Buch.PageSetup.PageHeight = PageSize.A6Height;
Buch.PageSetup.PageWidth = PageSize.A6Width;
Section section = Buch.Sections.Add();
section.PageInfo.Margin.Left = 0;
section.PageInfo.Margin.Right = 0;
section.PageInfo.Margin.Inner = 1.8f.CmToPoint();
section.PageInfo.Margin.Outer = 1.2f.CmToPoint();
section.PageInfo.Margin.Bottom = .3f.CmToPoint();
section.PageInfo.Margin.Top = 2.1f.CmToPoint();

// setting up table
Table ratIndexTable = new Table(section);
ratIndexTable.ColumnWidths = 4f.CmToPoint() + " " + .5f.CmToPoint() + " " + 2.6f.CmToPoint();
ratIndexTable.IsFirstRowRepeated = false;
section.Paragraphs.Add(ratIndexTable);
foreach (…)
{
// Add row and cells
}

Thanks in advance for your help.

Hi Markus,

Thanks for using our products.

I have tried replicating the issue using Aspose.Pdf for .NET 6.1.0 and I am unable to notice any issue. Can you please take a look over the attached PDF document and try replicating the issue using the code snippet that I have attached. Can you please share which version of Aspose.Pdf for .NET you are using ? We apologize for your inconvenience.

Hi.


Thank you for the quick answer. I tried the code fragment but changed the inner and outer margins to 30 and 20 respectively. What I get is a PDF where the left edge of the table is exactly at the same place on all the pages. What I expect is a table that is placed 30pt from the left edge of the page (inner margin) on odd pages and 20pt from the left edge on even pages (outer margin). In the PDF I attached to the first post, the table should be aligned with the lines drawn in header and footer. Text after the table is again positioned correctly, (see code snippet and PDF attached to this post).

We are using Aspose.Pdf 6.1.0 for .Net

Hi Markus,<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as <span style=“font-family:“Arial”,“sans-serif””>PDFNEWNET-30196. We
will investigate this issue in details and will keep you updated on the status
of a correction.<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””><span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

We
apologize for your inconvenience.


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


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

Hi Aspose!
Can you tell me .How to add multiple tables in different pages/new pages.The broken Rows is continuing to next new page.If broken row in continued with next new page. Then next table should come to next new page. Please can you tell me how to do that.
i have 3 tables inserting into PDF Table
in one page only 25 lines allowed after that it continue to new page for table 1. then table 2 come along with that new page. i need the table to display next new page.
regards
Subbu

Hi Subbu,

Thanks for using our products.

Kindly check the documentation link Control Table and Row Splitting for more details. You can achieve this functionality by using table1.IsFirstRowRepeated = true;

Please feel free to contact support in case you need any further assistance. We apologize for your inconvenience.

Thanks & Regards