"PageSetup.FirstPageNumber" property not uses for print or render to pdf

Hi!


I use version 7.1.
I found that PageSetup.FirstPageNumber don’t work absolutely correct when I save my workbook as xlsx or render to pdf.
I wrote this code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[ 0 ];
Cells cells = worksheet.Cells;
cells[“A1”].PutValue( “1” );
cells[“A100”].PutValue( “1” );
PageSetup pageSetup = worksheet.PageSetup;
pageSetup.SetFooter( 2, “Page &P” );
pageSetup.FirstPageNumber = 3;
workbook.Save( “Book1.xlsx” );
workbook.Save( “Book1.pdf” );

When I open workbook in Excel and call “print preview”, the page number start from 1, not from 3. If I open page setup, I see first page number “auto”, not “3”. When I open pdf, the page number also start from 1, not from 3.

Also I found the reason for Excel. I unpacked Excel workbook and Cells workbook. In Excel file “xl\worksheets\sheet1.xml” in tag "<pageSetup " there is additional attribute useFirstPageNumber=“1”. If it missing, Excel ignore attribute “firstPageNumber=”.
When I add useFirstPageNumber=“1” attribute into Cell workbook, Excel open and print workbook correctly.

My experience with pdf format is very poor, so, unfortunately, I don’t know, how to fix render to Pdf.

Regards, Alex.

Hi Alex,

I can find the issue using your sample code as you pointed out. The FirstPageNumber is always set to “Auto” even though we set it manually to other value in the code. I have logged a ticket with an id: CELLSNET-40321. We will look into it soon.

Thank you.

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


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