Up till now, there was a simple document to image conversion process. With the GroupDocs.Conversion for Java release version 19.10, we’ve added a number of interesting features for image conversion.
- Set color mode when converting to JPEG
- Option to set compression mode
- Adjust image brightness and contrast
- Set gamma
- Option to flip image
Have a look at its implementation of the above features in Java
ConversionConfig config = new ConversionConfig(); | |
ConversionHandler conversionHandler = new ConversionHandler(config); | |
String source = "source.pdf"; | |
ImageSaveOptions saveOptions = new ImageSaveOptions(); | |
saveOptions.setFlipMode(ImageSaveOptions.FlipModes.FLIP_X); | |
saveOptions.setBrightness(50); | |
saveOptions.setContrast(50); | |
saveOptions.setGamma(0.5f); | |
ConvertedDocument convertedDocument = conversionHandler.convert(source, saveOptions); | |
convertedDocument.save("result"); |
Conversion from CDR
CDR is a vector graphics file. API now allows you to convert from CDR.
Improvements
Along with new features, there are some improvements and bug fixes as well. Following are the major improvements:
- Conversion from Excel95/5.0 XLS files
- Set image quality when converting to WebP
- Remove HideComments from SaveOptions
Bug Fixes
Previously, there was an issue (Exception: Cannot open an image) in conversion of Cells to Image. We’ve fixed it.
API conflict with Ch.qos.logback is also resolved.
Moreover, you can now generate scalable/Adjustable HTML. There is a property in HtmlSaveOptions known as FixedLayout. Try to set it to false. This will generate simplified markup and layout.
HtmlSaveOptions saveOptions = new HtmlSaveOptions(); | |
saveOptions.setFixedLayout(false); |
We’d recommend you to download and integrate API version 19.10 and enhance your document conversion experience. If you face any issue, post it on the forum.