We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Does Aspose.Cells support previewing before printing?

@Diego2020,
We have further evaluated this scenario and would like you tp try the following:

  1. With your sample code shared here, try the code on your side such that the default font name “等线” is changed to “DengXian”(English name of the font)". This test should be run with the regular release Aspose.Cells for .NET v20.7.
  2. You may also try the scenario keeping the font name as “等线” but using the attached latest hotfix v20.7.7 below and share the feedback.
    Aspose.Cells20.7.7 For .Net4.0.Zip (5.4 MB)

Tested with version 20.7.7.0(must be 20.7.7.0,20.7.0.0 is incorrect)
The test code is attached
You can’t use “DengXian”
To use “Deng” or “simsun”(C:\Windows\Fonts\Deng.ttf or C:\Windows\Fonts\simsun.ttc file name)
The pagination is currently correct
But there are differences from Excel print Preview
The difference is embodied in the position of “Page1, Page2, Page3, Page4, Page5”
Please refer to the attached code and screenshot for details.Test.zip (6.9 MB)

Please help to correct:
1: PageX display position
2: Automatically match fonts inside Aspose.Cells

@Diego2020,

Thanks for the sample code, output files and screenshots.

We need to investigate your issue thoroughly based on your resources files. We have logged a ticket with an id “CELLSNET-47532” for your issue. We will look into it soon. The ticket is logged as following:
CELLSNET-47532 - Rendering differences comparing with MS Excel print previews

Once we have an update on it, we will let you know.

@Diego2020,

Please do not change the default Font name in the fix v20.7.7, use the code as in the attached archive “NotChangeDefaultFont.zip”, it will be OK.
NotChangeDefaultFont.zip (1.1 KB)

By the way, for your issue/queries :

You can’t use “DengXian”
To use “Deng” or “simsun”(C:\Windows\Fonts\Deng.ttf or C:\Windows\Fonts\simsun.ttc file name)

Actually, Font Name and font file name are different. We use Font Name encoded inside the font file content.

Also, please share the font file “C:\Windows\Fonts\Deng.ttf” on your side. We need to investigate it on our end.

Using the test code you provided, the results are still wrong

The output file and screenshot are attachedToImage.zip (250.8 KB)
Console.WriteLine.png (7.1 KB)

Deng.zip (9.5 MB)
This is the Deng.ttf file

@Diego2020,
Please do the following steps and let us know your feedback:

  1. Add code to print the Aspose.Cells version.
...
Console.WriteLine("Aspose.Cells version :" + Aspose.Cells.CellsHelper.GetVersion());
Console.WriteLine("DPI :" + Aspose.Cells.CellsHelper.DPI);
...
  1. Do not change the source file “test.xlsx” anyway. Until now, I can see at least two versions of source file “test.xlsx” included in your shared files.

  2. Share your total project, with the output images, pdf file and the console output of a single run. In the other word, the output should be sync.

The code was tested with 20.7.7
I didn’t have to change the default font and I got it right
Thank you for following up on this issue

@Diego2020,
We are glad to know that you have got it right. Should you have any issue with Aspose.Cells API, feel free to contact us. We will be glad to assist you.

@Diego2020,

It will be helpful if you can share why you got the wrong results with the fix v20.7.7.

The test was only 20.7.7 effective

None of the other versions is right

@Diego2020,

Ok, got it now.