Page Numbering of Excel files with multiple worksheets(ECDCTS-10372)


For your requirement:

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45829

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

I have few queries, could you please answer them?

  1. Why print quality needs to be set?
  2. What is the impact of setting this parameter?
  3. How the value 600 is arrived in this case?
  4. What is the relation to setting display as 100?
  5. Why this is happening only for certain files? For what sort of files, print quality needs to be set?
  6. What’s the impact of the existing rendered files after adding the print quality code?


Different print quality may result different page layout/break. But now days, Excel only supports 600 print quality for Excel “Save as” and considers other print quality as 600.

For xlsx file, the default vaule of print quality is 600. So if print quality is not set(use default value) or set to 600 in the source file, the print quality is 600.

Print quality only impacts the page layout/break.

Excel has different column width, different page layout/break in different display setting(Windows->Settings).

How to check the print quality of xlsx file? Is it possible to set the prtint quality as 600 manually for the xlsx file and render using Aspose (excluding the print quality code), will that work? Will that generate 114 pages?


Please following the screenshot to set print quality manually in Excel->Page Layout.
Screenshot_print_quality_setting.png (236.7 KB)

Also, for your requirement, we have logged a ticket for it.

I have manually adjusted the print quality for each worksheet in Excel and shared the screenshot of console displaying the print quality which is 600 now. Despite, why is Aspose still unable to generate 114 pages. It is generating 119 pages. (2.1 MB)


As previously replied. After setting the print quality to 600dpi, you also need to set the Windows display to 100%. If you still have any questions or confusion, please provide your Windows display settings information. We will check it soon.

Setting Windows display to 100% is required for Excel when saving as PDF.

But why windows display setting to 100% is required for Aspose rendition?
I had shared an excel earlier where the print quality of the worksheets were 1200dpi. I have manually set the print quality to 600dpi for the same Excel and tried the below code -

Workbook wb = new Workbook(filePath + “DMRS-02321-LLB.xlsx”); + “output_java.pdf”);

And the above code generates 119 pages instead 114 pages though the print quality of the worksheet is 600dpi.
Please refer the screenshot of the console, I have sys out the print quality of the worksheet before Aspose rendition.


We are extremely sorry but Aspose.Cells does provide accurate results with 100% display settings of OS for rendering features like Sheet to image and Excel to PDF. It (100% display settings) may not be required by MS Excel which is a UI application but Aspose.Cells is a library.

Excel printed 114 pages, but we generated 119 pages. We have added an issue CELLSJAVA-45830 .
We will look into it.

Please help me understand few aspects-

  1. What distinguishes the original Excel file from the updated Excel(after setting 600dpi manually)? Is there a difference between manually setting 600dpi in Excel and setting it through Aspose code? What might be the reason for the updated Excel(600dpi), processed with Aspose, not generating the expected 114 pages?
  2. Setting the print quality in Aspose code, how does it affect Excel files that don’t currently exhibit any issues?
  3. Is this considered a bug and if so, when can we except a fix? Do you have an ETA?
  4. We are dealing with a critical customer situation. Could you please recommend any possible workarounds?



We have recorded this information under your current ticket “CELLSJAVA-45830” in our database. We will thoroughly review your questions and other related aspects. Once we have any updates, we will notify you here.

Could you kindly provide more details regarding the purpose for which tickets “CELLSJAVA-45829” and “CELLSJAVA-45830” were created?


Here is the details (ticket ID and title) about two logged tickets:

  1. CELLSJAVA-45829 - Page count is not right while rendering workbook with 1200 print quality setting to PDF.
  2. CELLSJAVA-45830 - The number of generated pages is not same as Excel.

The ticket “CELLSJAVA-45830” was created as we found MS Excel printed 114 pages but Aspose.Cells generated 119 pages.

Kindly confirm whether updating the Aspose code setting print quality will impact the existing Excel files that currently show no issues?


There should be no impact when setting print quality, so you may do that.


There should be no difference between manually setting 600dpi in Excel and setting it by Aspose.Cells. We are still analyzing the file that why Excel generates 114 pages but Aspose.Cells generates 119 pages. The ticket “CELLSJAVA-45830” had been logged for it.

If we have any updates, we will update it here.


Row height of 600dpi set source file is changed. e.g. You can check row height of the 4th sheet.(workbook.getWorksheets().get(3).getCells().getRowHeight(rowIndex)). It seem that you manually set the 600 dpi in Excel on a machine with Windows display setting not set to 100%. Since the row height is changed, so page count is different.

It is safe that you use wb.getWorksheets().get(i).getPageSetup().setPrintQuality(600); to set the print quality.

Thank you for clarifying. I recieved an additional Excel file from the customer. When setting the print quality in Aspose code, it generates 99 pages, whereas using 100% display settings, saving as pdf in Excel results 91 pages. Could you please provide an explanation? I have attached the excel file with generated pdfs.
TEST page numbering IMM 2000 - (4.0 MB)

Thanks for further details. Let us investigate and analyze your issue in details. Hopefully we could figure it out soon. Once we have an update on it, we will let you know.