BindXML page breaks


#1

I am working on a project to convert Excel 2003 files to PDF. So far I am able to take the Excel file and convert it to XML using ASPOSE.Cells. That works great. However, I am running into several issues:

1. Page numbers. The excel file has Page # of ## at the bottom of each page. I know I can add a header/footer on the PDF, but each time I try following the demo code, it either does not add, or it adds the page number on a blank first page. I am using BindXML to convert the XML file to PDF.

2. Repeating Rows. The excel file always has the first 3-7 rows (depending on the report) repeating, so the report name and column headers show up at the top of each page. This does not seem possible to do coming from Cells to PDF. Is there a way to do this?

3. Page breaks. The pages are breaking in odd places. I am enclosing an example Excel file, and the PDF that is created. Note how it breaks oddly between the data on the PDF, but not when printing from Excel. Any ideas as to what is causing that?

Thanks.

James Bickley


#2

Here is the excel file.


#3

Dear James,

Thank you for considering Aspose.

1. Page number in footer is supported in Aspose.Pdf but Aspose.Cells has not support it when converting to PDF. I will notify them to add support for it. As a workaround, you can add the following code before Saving the Pdf document:
HeaderFooter hf = new HeaderFooter();
Text t1 = new Text("Page $p of $P");
t1.Margin.Top = 10;
hf.Paragraphs.Add(t1);
pdf.IsPageNumberForDocument = true;
foreach(Section sec in pdf.Sections)
{
sec.OddFooter = sec.EvenFooter = hf;
}

2. Only Repeating first row is supported in Aspose.Pdf. I will support repeating first n rows in several days.

3. I need to contact the Aspose.Cells team to resolve the page break issue.


#4

Thank you. Hopefully we can get these issues resolved.

James


#5

Dear James,

I have contacted the Aspose.Cells team. The page break is set by user in the xls but the table in pdf and xls has different height which makes the page breaking looks bad. We will try to resolve this problem but I don't think we can finish it in short time. As a workaround, please remove the page break in the xls and let Aspose.Pdf to process the page breaking.