I use the following code to convert Word to Tiff.
Document doc = null;
try {
doc = new Document(is);
} finally {
is.close();
}
doc.save(outputname + ".TIFF", SaveFormat.TIFF);
Currently I do not use ImageSaveOptions.
If I convert 100KB word file, the output TIFF file size is 3.5MB. The output gets so big.
So I decided to use ImageSaveOptions as follows.
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.TIFF);
options.setTiffCompression(TiffCompression.CCITT_4);
options.setResolution(300);
Then the output file size gets smaller than earlier but output file do not get all the colors from the original file.
My question is, is there a way to make the output TIFF file size smaller yet preserve all the original colors and considerably good resolution?
Hi Tashani,
Thanks for your inquiry. The TiffCompression.CCITT_4 is used for black and white output Tiff files.
Could you please attach your input Word document here for testing? I will investigate the issue on my side and provide you more information.
Attached a sample file. Thanks!
Hi Tashani,
Thanks for sharing the detail. I have tested the scenario using latest version of Aspose.Words for Java 14.12.0 and have not found the shared issue. Please use Aspose.Words for Java 14.12.0. I have attached the output document with this post for your kind reference. This output is generated with resolution 300.
ImageSaveOptions.Resolution property is used to get or set the resolution for the generated images, in dots per inch. If you increase this resolution value, the output file size will be big. The default value is 96.
Please let us know if you have any more queries.