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.