I'm using the library to convert an excel to a png image. The code that i'm using is this:
- Code: Select all
com.spire.xls.Workbook w = new com.spire.xls.Workbook();
w.loadFromFile(pathname);
w.getConverterSetting().setSheetFitToPage(true);
w.getConverterSetting().setSheetFitToWidth(true);
w.getConverterSetting().setClearCacheOnConverted(true);
w.getConverterSetting().setYDpi(1200);
w.getConverterSetting().setXDpi(1200);
Worksheet worksheet = w.getWorksheets().get(0);
worksheet.saveToImage(png_pathname);
The result image is totally inaccurate as it can be see in the attached image. The text is not aligned well.
How can I resolve this problem?