Unable to generate the PDF from Xlsx file

Issue Description.

I tried adding the Xlsx file to Aspose checker and there was pop up stating converted into PDF and vanished within few seconds.

But I was unable to find the converted PDF document.

Tested in Aspose : 23.1.0
Aspose issue.7z (12.5 KB)

@IDBSSupport

It seems you are experiencing issues with generating a PDF from an XLSX file using Aspose.Cells. The pop-up indicating that the conversion was successful but not being able to find the resulting PDF document can be frustrating. Here are some steps you can take to troubleshoot and resolve this issue:

  1. Check Output Directory: Ensure that you are saving the PDF to a specified output directory. If the output path is not set correctly, the PDF may not be saved where you expect it. You can specify the output directory in your code like this:

    // Define the output directory
    string outputDir = "C:\\Your\\Output\\Directory\\";
    
  2. Use PdfSaveOptions: If your Excel file contains errors that might prevent successful conversion, you can use the PdfSaveOptions.IgnoreError property. This allows the conversion to proceed even if there are issues with the content of the Excel file. Here’s an example of how to implement this:

    // Load the workbook
    Workbook workbook = new Workbook("path_to_your_file.xlsx");
    
    // Create PdfSaveOptions and set IgnoreError to true
    PdfSaveOptions saveOptions = new PdfSaveOptions();
    saveOptions.IgnoreError = true;
    
    // Save the workbook as PDF
    workbook.Save(outputDir + "output.pdf", saveOptions);
    
  3. Confirm File Existence: After running your conversion code, check the specified output directory to confirm that the PDF file was created. If it is not there, ensure that your application has the necessary permissions to write to that directory.

  4. Check for Exceptions: If there are any exceptions thrown during the conversion process, they may provide insight into what went wrong. Make sure to handle exceptions in your code to catch any issues that arise.

  5. Review Documentation: For more detailed guidance on converting Excel files to PDF and handling errors, you can refer to the official Aspose documentation on ignoring errors during PDF rendering here and the general conversion process here.

By following these steps, you should be able to troubleshoot the issue and successfully generate a PDF from your XLSX file. If the problem persists, consider sharing more details about your implementation for further assistance.

Sources:
[1]: Ignore Errors while Rendering Excel to PDF - Aspose Documentation
[2]: Convertir un fichier XLSX au format PDF - Aspose Documentation

@IDBSSupport
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): CELLSNET-57751

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.

@IDBSSupport
We have fixed this issue and will include the fix into the next version 25.2.

@simon.zhao May I know when will be the release date of the above defect fix?
Is there any work around available?

@IDBSSupport
We will release 25.2 in the next week.
This issue is caused by the invalid value of custom display unit.
Please remove settings about display unit now.

@simon.zhao So the test file that I have provided does not contain any display unit.
Could you please assist!

@IDBSSupport
You can unzip the Test_chart.xlsx file, which contains :

<c:dispUnits>
    <c:custUnit val="1.0000000000000005E-8"/>
</c:dispUnits>

This is invalid.

@simon.zhao Could you please clarify the provided steps?

@IDBSSupport
You can unzip the file , edit xl/charts/chart1.xml,remove the dipsunits node, zip the the files to xlsx again.
Or try the codes :
chart.ValueAxis.DisplayUnit = DisplayUnitType.None;
We will release the new version 25.2 in this week.

@simon.zhao I was able to locate the dipsunits node and followed both processes you shared. Unfortunately, the XLSX file is getting corrupted in both cases.

@IDBSSupport,

I first zipped the file “Test_chart.xlsx” → “Test_chart.zip” by changing its extension. Then I did unzip or extracted to get files. Then, I opened the file “xl/charts/chart1.xml” into notepad and removed the node “<c:dispUnits>....</c:dispUnits>” in the file. Now I re-saved the file. I then added the files to make an archive “Test_chart.zip” again. Finally, I changed the extension “.zip” to “.xlsx” back to convert “Test_chart.zip” to “Test_chart.xlsx”. I opened the final “Test_chart.xlsx” file into MS Excel and the file is opened fine and is not corrupted. Please find attached the final “Test_chart.xlsx” file in the zipped archive and let us know if the file is OK or not?
Test_chart.zip (11.9 KB)

The issues you have found earlier (filed as CELLSNET-57751) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi