Computer resolution setting 150% cell TO Pdf abnormal

Computer resolution setting 150% cell TO Pdf abnormal

image.jpg (114.0 KB)

Aspose.Cells.License li = new Aspose.Cells.License();
li.SetLicense(AsposeExcel.LicFilePath);
Workbook wb = new Workbook(“c:\ddd.xlsx”);
wb.Save(aimsPath, SaveFormat.Pdf);

image.png (44.4 KB)

Source.zip (13.1 KB)

@constgroup,

Please note, for rendering features (e.g. Excel to PDF, Sheet to image, etc.), Aspose.Cells only supports to render in 100% display settings. So, you may specify the DPI at the start of your program in code for your requirements:
e.g.
Sample code:

.......
CellsHelper.DPI = 96;//This should be first line and before your actual code and it will be equal to 100% display settings of your os/machine. 
//........
// your code goes here.
//.......

Using the above line will ensure to get the same results (for output PDF/image) as you could generate (Save as PDF) in “100%” display settings.

Let us know if you still find the issue.

1 Like

That’s great, the problem has been solved, thank you very much.

@constgroup,

You are welcome and good to know that your issue is resolved by the suggested line of code. In the event of further queries or issue, feel free to write us back.

The Windows 10 system is set to 150%. After the computer restarts, it is not set to 100%. This problem will still occur.

@constgroup,

Please try the suggested line of code in the post at the start of your program, it should fix your issue now.

Let us know if you still find the issue even after setting the DPI to “96” in code.

I did set CellsHelper.DPI = 96 when the program started.
I discovered this problem last Saturday, and today I tried various methods to reproduce it. But there is no recurrence, I plan to give up, thank you for your support.

@constgroup,
Thanks for the feedback. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

I did set CellsHelper.DPI = 96 when the program started.
I discovered this problem is repeated.

@cstWbz,

Could you please share your sample code (runnable) and sample files (input Excel file and output file, etc.). Also, what display settings you are using in your os machine (e.g. 100%, 150%, etc.)?

PS. please zip the Excel and other resource files prior attaching here.

The Windows 10 system is set to 150%. Here are some documents.Files.zip (110.3 KB)

@cstWbz,

Thanks for the PDF file and screenshot.

We need your template Excel file to revaluate your issue. So, kindly zip and attach your source Excel file. Also, I found you are using an older version of Aspose.Cells for .NET v20.11. Please try using our latest version, i.e., Aspose.Cells for .NET v22.5 if it makes any difference.

Thank you for your reply. The problem has been solved.

@cstWbz,

It seems your issue is sorted out by newer versions. Feel free to write us back if you have further queries or comments, we will be happy to assist you soon.