HTML to Excel with an image

Hi,


I’m looking at using Aspose Cells to convert HTML output into XLSX, my HTML includes an image.

I’ve been unable to get the image to appear in the XLSX file.

I’ve tried creating HTML with just <IMG src …>
I’ve tried creating the HTML by saving an XLSX file in HTML format with the image
I’ve tried creating the HTML using ASPOSE XLSX to HTML.

When I look at the HTML in IE all three versions are working with the image displayed.

My code (copied from your examples) is

public class HTMLConvertor {
public static void main(String[] args) {
HTMLLoadOptions options = new HTMLLoadOptions(LoadFormat.HTML);
options.setAttachedFilesDirectory(“T:\KDW\Aspose\HTML2XLSX\excel format\F20150806123156_000001_files”);
try {
Workbook book = new Workbook(“T:\KDW\Aspose\HTML2XLSX\excel format\F20150806123156_000001.htm”, options);
book.save(“T:\KDW\Aspose\HTML2XLSX\excel format\PC Version.xlsx”, SaveFormat.XLSX);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Thanks
Ken

Hi,


Thanks for providing us details and sample code.

Please try our latest version/fix: Aspose.Cells for Java v8.5.2 (you may download it here: http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/entry650410.aspx)
I have evaluated your scenario/ case using the following sample code with a template HTML file (that contains an image - I have created the HTML file in MS Excel manually), it works fine with it. Please find attached the zipped archive that contains the source html (with resource files folder) and output Excel file for your reference:
e.g
Sample code:

HTMLLoadOptions options = new HTMLLoadOptions(LoadFormat.HTML);
Workbook book = new Workbook(“f:\files\Excelimage1.htm”, options);
book.save(“f:\files\outExcelimage1.xlsx”, SaveFormat.XLSX);


Thank you.