cells source code:
src.zip (1.6 KB)
origin cells:
12345654321.xlsx.zip (159.4 KB)
before converted:
image.jpg (197.3 KB)
after converted:
image.png (488.7 KB)
Please have a check.
cells source code:
src.zip (1.6 KB)
origin cells:
12345654321.xlsx.zip (159.4 KB)
before converted:
image.jpg (197.3 KB)
after converted:
image.png (488.7 KB)
Please have a check.
Cause
You are experiencing issues with the conversion of Excel files using Aspose.Cells, specifically with the output images not meeting your expectations. This could be due to various factors, such as differences in rendering settings or the specific content of the Excel file.
Solution
To troubleshoot and resolve the issue, please follow these steps:
Check Conversion Settings: Ensure that you are using the correct settings for the conversion process. For example, if you are converting to an image format, make sure to specify the appropriate options.
Review the Source File: Examine the original Excel file for any complex formatting, shapes, or charts that might not render correctly in the output image.
Update Aspose.Cells: Ensure you are using the latest version of Aspose.Cells, as updates often include bug fixes and improvements related to file conversions.
Test with Simplified Content: Create a simplified version of your Excel file with basic content and formatting to see if the conversion works as expected. This can help isolate the issue.
Code
Here’s a basic example of how to convert an Excel file to an image using Aspose.Cells:
// Load the Excel file
Workbook workbook = new Workbook("path/to/your/file.xlsx");
// Create an instance of ImageOrPrintOptions
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.ImageFormat = ImageFormat.Png; // Set the desired output format
// Create a SheetRender object for the first worksheet
SheetRender sr = new SheetRender(workbook.Worksheets[0], options);
// Render the worksheet to an image
sr.ToImage(0, "output/image.png");
Next Steps
I look forward to your feedback on whether this resolves your issue!
I used the latest aspose-cells-25.6, please use src.zip to run the code and tell me how to solve this problem.
@hucq_landray_com_cn
By testing with sample file and code on the latest version v25.7, we can reproduce the issue. Image was lost when converting file to html.
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-46433
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.
This is to inform you that your issue (Ticket ID: “CELLSJAVA-46433”) has been resolved. The fix/enhancement will be incorporated into the upcoming release of Aspose.Cells (v25.8), which is scheduled for the first half of August 2025. You will be notified when the new version is published.
The issues you have found earlier (filed as CELLSJAVA-46433) have been fixed in Aspose.Cells for Java 25.8.