Aspose.Pdf for Java 11.2.0 has been released. We are pleased to announce that new version of Aspose.Pdf for Java not only includes all the features and enhancements introduced in Aspose.Pdf for .NET 11.2.0 but also contains the feature to change PDF document colorspace form RGB to Grayscale and set background image of submit button. It also includes some important bug fixes along with above stated enhancements. Please check release notes of Aspose.Pdf for Java 11.2.0 for complete list of bug fixed.
The following sections describe some details regarding these newly added features/enhancements.
We received a requirement to convert a PDF document colorspace from RGB to Grayscale, so that it would be faster while printing those PDF files. Also when file is converted to Grayscale, the size of document is reduced but with this change, the quality of document may drop. The feature is already supported in Aspose.Pdf for .NET version and now it is also supported in Java version of Aspose.Pdf i.e. Aspose.Pdf for Java 11.2.0. In order to accomplish this requirement, following code snippet can be used.
Document document = new Document(“input.pdf”);
com.aspose.pdf.RgbToDeviceGrayConversionStrategy strategy = newcom.aspose.pdf.RgbToDeviceGrayConversionStrategy();
for (int idxPage = 1; idxPage <= document.getPages().size(); idxPage++)
Page page = document.getPages().get_Item(idxPage);
Add background image of submit button
One of the customers wants to set the background image for submit button over form. We can set background image of submit button by using addImage() method in DOM approach as following.
Document doc = new Document(“PdfWithAcroForm.pdf”);
com.aspose.pdf.ButtonField button = (com.aspose.pdf.ButtonField)doc.getForm().get_Item(“buttonField”);
java.awt.image.BufferedImage img = ImageIO.read(new File(“image.png”));
Other Enhancements & Improvements
The other most notable enhancements in this release are as follow:
- How to add Grouped ChekBoxes.
- Convert XML file to PDF.
- How to add transparent text in PDF.
- How to add drawing with transparent Color.
Aspose.Pdf for Java Resources
The following resources will help you work with Aspose.Pdf for Java:
- Home page for Aspose.Pdf for Java
- Download Aspose.Pdf for Java
- Aspose.Pdf product family forum – Post your technical questions and queries, or any other problem you faced while running Aspose.Pdf APIs.
- Aspose.Pdf for Java online documentation – help documentation and API reference documents.
- Enable Blog Subscription – Do not limit yourself, you can keep yourself updated with the latest news on Aspose.Pdf APIs, new features, fixes and other API related topics by subscribing to Aspose.Pdf blog.
- Aspose.Pdf for Java Examples – We have published our code examples on the social coding website GitHub.com. Anyone could explore the code examples for learning purposes.