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)
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.)
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);
}
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.
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.
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?
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!
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!
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.
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?
Setting the print quality in Aspose code, how does it affect Excel files that don’t currently exhibit any issues?
Is this considered a bug and if so, when can we except a fix? Do you have an ETA?
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.