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

Though the above Aspose code produces 114 pages yet excel 2019 produces 88 pages only even after applying the settings mentioned above.
Please let me know the reason.
I have attached the screenshot of 100% display settings and “Letter” as page size for your reference.
DMR Index.PNG (62.0 KB)

DMR Template.PNG (95.1 KB)

Immulite 2000 DMR.PNG (114.1 KB)

PageSize.PNG (83.5 KB)

Revision History.PNG (85.1 KB)

Thanks!

@rnara ,

  1. 100% display setting is the settings in Windows->Settings.
    display_setting_100%.jpg (116.2 KB)

  2. Please set “English(United States)” as default for authoring language in Excel->Options->Language.
    Excel_default_authoring_language_English_US.png (106.4 KB)

  3. reboot your machine, then open the source file in Excel, you will see 114 pages at Excel printview.(Please don’t change the paper size setting at Excel printview. As the paper size is set to A4 in every sheet.)

  4. The page count at Excel printview should be same as the page count of Excel saved pdf file.
    If not, please the change the default paper size to A4 of your default printer.

Okay got it. But, is it possilbe to generate 114 pages by Aspose excluding below code?

for(int i = 0; i < wb.getWorksheets().getCount(); i++)
{
//it is 1200 in the source file
wb.getWorksheets().get(i).getPageSetup().setPrintQuality(600);
}

Any workaround?
Thanks!

@rnara,

I am not sure that without using the suggested code segment you will be able to generate 114 pages on your end considering display settings, paper size and other factors. Anyways, we will look into it further and get back to you.

@rnara
By using the following code for testing, a PDF result of 115 pages can be generated. Please refer to the attachment. output_java.zip (1.8 MB)

The sample code as follows:

Workbook wb = new Workbook(filePath + "DMRS-02321-LLB.xlsx");

//for (int i = 0; i < wb.getWorksheets().getCount(); i++)
//{
//    //it is 1200 in the source file
//    wb.getWorksheets().get(i).getPageSetup().setPrintQuality(600);
//}


wb.save(filePath + "output_java.pdf");

@rnara

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?
    Thanks!

@rnara

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?

@rnara

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.
DMRS-02321-LLB.zip (2.1 MB)
Thanks!

@rnara

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”);
wb.save(filePath + “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.
Thanks!

@rnara,

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.

@rnara
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?

Thanks,
Bhupali

@rnara,

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?
Thanks,
Bhupali

@rnara,

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?