Excel spredsheet fails when converting to PDF

Hi Aspose team,

We have problems converting the attached Excel file to PDF.
Måleprotokoll.zip (192.1 KB).

We get this exception in VS:
image.png (42.4 KB)

Using this code:
Aspose.Cells.License license;
license = new Aspose.Cells.License();
license.SetLicense(“Aspose.Total.NET.lic”);
string dataDir = “c:\temp\”;
Workbook doc = new Workbook(dataDir + “testt.xlsx”);
doc.Save(dataDir + “output.pdf”, Aspose.Cells.SaveFormat.Pdf);

Thanks in advance for investigating this problem :slight_smile:

@andersalvsaker

It seems you’re encountering an issue while converting an Excel file to PDF using Aspose.Cells. The exception you’re seeing could be due to various reasons, such as file corruption, unsupported features in the Excel file, or issues with the Aspose.Cells library.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Check the Excel File: Ensure that the Excel file (testt.xlsx) is not corrupted and can be opened without issues in Microsoft Excel.

  2. Update Aspose.Cells: Make sure you are using the latest version of the Aspose.Cells library, as updates often include bug fixes and improvements.

  3. Use Page Breaks: If your Excel file has a complex layout, consider using page breaks to control how the content is rendered in the PDF. You can implement this by adjusting the page setup in your workbook.

    Here’s a code snippet to illustrate how to do this:

    using Aspose.Cells;
    using Aspose.Cells.Rendering;
    
    Workbook workbook = new Workbook("c:\\temp\\testt.xlsx");
    PdfSaveOptions options = new PdfSaveOptions();
    options.OnePagePerSheet = true; // Optional: Adjust based on your needs
    workbook.Save("c:\\temp\\output.pdf", options);
    
  4. Check for Unsupported Features: Review the Excel file for any features that may not be supported by Aspose.Cells, such as certain formulas, charts, or formatting.

  5. Error Handling: Implement error handling in your code to capture and log the specific exception details, which can help in diagnosing the issue further.

If the problem persists, consider reaching out to the Aspose support forum with the specific exception details and the Excel file for more targeted assistance.

Feel free to ask if you have any further questions!

@andersalvsaker,

Thanks for the template Excel file and screenshot.

After initial testing, I am able to reproduce the issue as you mentioned by converting your template Excel file to PDF. I found an exception “Shape to image Error” when converting the XLSX file to PDF.

We require thorough evaluation of the issue. 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-59176

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.

1 Like

@andersalvsaker,

We are pleased to inform you that your issue (Ticket ID: “CELLSNET-59176”) has been resolved. The fix/enhancement will be included in the upcoming release (Aspose.Cells v25.11) that we plan to release in the first half of November 2025. You will be notified when the next version is released.