Aspose.PDF for Java 11.2.0 has been released. We are pleased to announce that the 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 from RGB to Grayscale and set the 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 a complete list of bug fixed.

The following sections describe some details regarding these newly added features/enhancements.

Convert PDF Document Colorspace from RGB to Grayscale

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 a file is converted to Grayscale, the size of the document is reduced but with this change, the quality of the 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, the following code snippet can be used.

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"));
button.addImage(img);
doc.save("output.pdf");

Other Enhancements & Improvements

The other most notable enhancements in this release are as follow:

Aspose.Pdf for Java Resources

The following resources will help you work with Aspose.Pdf for Java: