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

Free Support Forum - aspose.com

Why is it recognized as zip


public static void main(String[] args) throws Exception {
Workbook book = new Workbook("");
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
// 指示当单元格字体不兼容时是否只替换字符的字体。
final String filename = “asdsad.jpg”;
// Get the first worksheet.
final WorksheetCollection worksheets = book.getWorksheets();

    for (int i = 0; i < worksheets.getCount(); i++) {
        // Create a SheetRender object for the target sheet
        final Worksheet sheet = worksheets.get(i);
        SheetRender sr = new SheetRender(worksheets.get(i), imgOptions);
        for (int j = 0; j < sr.getPageCount(); j++) {
            // Generate an image for the worksheet
            final String name = "aa.jpg";
            log.info("excel outputFilePath:"+name);
            final Instant now = Instant.now();
            sr.toImage(j, name);

Could you please share the sample Excel file again? You may zip the Excel file before attaching it here on the forum.

You may describe the issue little more like where do you recognize it as zip. Are you getting the saved image as zip file?


I was able to download your attachment from its source in your first post. When I tried to open into MS Excel, it gives an error and denotes it as not a valid Excel file. When I opened your file into notepad, it gives this display, see what contents are shown of your file in the screenshot (attached).
sc_shot1.png (11.5 KB)

In short, your so called XLSX file is not a valid MS Excel file, it’s kind of error which is retrieved/saved in text file. As asked by Ahsan Iqbal, please re-attach a valid Excel file, so we could evaluate your issue precisely.