Using the interface provided by Aspose to convert Excel to PNG, some graphics are missing, and it is normal to convert to PDF
image.png (62.3 KB)
image.png (272.1 KB)
this is my code:
String designerFile = "D://Aspose//EPPR_51971//EPPR_51971.xlsx";
try {
Workbook workbook = new Workbook("D://Aspose//EPPR_51971//EPPR_51971.xlsx");
workbook.save("D://Aspose//EPPR_51971//output/EPPR_51971.html", SaveFormat.HTML);
workbook.save("D://Aspose//EPPR_51971//output/EPPR_51971.pdf", SaveFormat.PDF);
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setImageFormat(ImageFormat.getPng());
options.setOnlyArea(true);
options.setOnePagePerSheet(true);
options.setTransparent(false);
options.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
options.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
SheetRender render = new SheetRender(workbook.getWorksheets().get(0), options);
render.toImage(0, "D://Aspose//EPPR_51971//output/EPPR_51971.png");
} catch (Exception e) {
e.printStackTrace();
}
this is the file:EPPR_51971.zip (2.7 MB)