Hi,
Hi,
Please try the following code, it will generate multiple tiff from xls/xlsx file.
Please use the latest version:
Aspose.Cells for Java (Latest Version)
Java
String path = “F:\Shak-Data-RW\Downloads\source.xlsx”;
Workbook wb = new Workbook(path);
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.setImageFormat(ImageFormat.getTiff());
String number = “”;
WorksheetCollection worksheets = wb.getWorksheets();
for(int idx = 0; idx<worksheets.getCount(); idx ++)
{
Worksheet sheet = worksheets.get(idx);
imgOptions.setHorizontalResolution(118);
imgOptions.setVerticalResolution(112);
imgOptions.setOnePagePerSheet(false);
imgOptions.setImageFitToPage(true);
SheetRender sr = new SheetRender(sheet, imgOptions);
for(int i = 0;i<sr.getPageCount();i++)
{
if (i < 10)
{
number = “00” + i;
}
else if (i >= 10 && i < 100)
{
number = “0” + i;
}
else
{
number = “” + i;
}
sr.toImage(i, path + “_” + sheet.getIndex() + number +“.tiff”);
}//for
}//for
Hmmm, I’m still getting 0 byte TIFFs. I’m using exactly your code.
I’ve added now jai_imageio.jar to the classpath, so the TIFF writer will be found.
Hi,
Thanks for using Aspose.Cells for Java.
We have investigation this issue further and found, we do not support conversion to TIFF images at this moment.
However, we have added a request for this feature in our database. We will look into this feature and support it.
Once, this feature is available, we will let you know asap by posting on this thread.
Hi,
We have already supported converting excel to tiff in java version.
You should add JAI lib when convert excel to tiff.
Please download and try this fix: Aspose.Cells for Java (Latest Version) and let us know your feedback.