Retrieve Signatures and their Images, Render Table on New page, & Control Image Stamp Quality with Aspose.Pdf for Java 9.1.0

Share on FacebookTweet about this on TwitterShare on LinkedIn

Aspose.Pdf for Java logoEver since we published the autoported merged Aspose.Pdf for Java API, we have been working hard to make this API as powerful and compelling as its sibling Aspose.Pdf for .NET. With every new release, we try to port the latest features available in Aspose.Pdf for .NET and introduce fixes for issues reported in earlier versions. In Aspose.Pdf for Java 9.1.0, we have introduced some exciting new features and enhancements which have made this API more compelling. Some of the new features introduced in this release are described below.

Control Image Quality when Adding as Stamp

The feature to add an image or text as a stamp in PDF files has been supported by Aspose.Pdf for Java for a while. However, recently we received a requirement to control the image quality when adding an images as a stamp object. The following code snippet shows the steps to control image stamp quality when adding it to a PDF document. For more information, read about how to control image quality when adding image stamp.

Document doc = new Document("PdfWithText.pdf");
ImageStamp stamp = new ImageStamp("butterfly.jpg");
// Specify the quality of the stamp image
stamp.setQuality (10);
doc.getPages().get_Item(1).addStamp(stamp);
// Save the updated document
doc.save("out.pdf");

Extracting Image from Signature Field

Aspose.Pdf for Java supports the feature to add, remove, and delete signatures from PDF documents. While adding a signature to a PDF file, we provide an image for the signature appearance and now Aspose.Pdf for Java offers the capability to read all signature objects and retrieve the images associated with each object. Please visit the following link for further details: Extracting Image from Signature Field.

Bookmark Points to Start of Page

Bookmarks are one of the important elements of PDF document as they allow readers to quickly move between different pages. Aspose.Pdf for Java has supported features for adding a bookmark, getting bookmarks and deleting bookmarks. Now the latest release supports editing the destination of a bookmark and point it to the start of a page. Or you can set the destination while creating a new bookmark inside a PDF document. Please visit the following link for further details: Bookmarks should Point to Start of Page.

Render Table on New Page

Tables are integral objects when displaying data inside PDF files. Aspose.Pdf for Java supports adding tables to PDF documents. By default, tables are added in a flow layout (top-left to bottom-right). Even if there is a space on the PDF page, you might need to render the table on a new page. To accomplish this requirement, the isInNewPage(..) method has been added to the BaseParagraph class. For more information, please visit Force Table Rendering in New Page.

Delete Images from PDF using ImagePlacementAbsorber

Aspose.Pdf for Java makes it possible to add text and image objects as well as extracting text and image objects from existing PDF documents. If you are certain about the index of an image inside the Images collection of a particular PDF page, you can use the following method to delete it: pdfDocument.getPages().get_Item(1).getResources().getImages().delete(1);.

However, if you need to search all the images inside a PDF file using ImagePlacementAbsorber and then delete images, please follow the instructions in Delete Image from PDF Resources Found by ImagePlacementAbsorber.

As well as the new features above, this new version includes fixes related to PDF to image conversion, saving PDF files in a particular PDF version, deleting images from PDF files, performance improvements when generating PDF files and much more. Go ahead, download and start exploring the new release of Aspose.Pdf for Java 9.1.0.