Get hyperlink from image and stable inter file format conversion with Aspose.Pdf for Java 17.7

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

A new release version Aspose.Pdf for Java 17.7 has been added to portfolio of Aspose.Pdf product family. This release offers a feature to Get hyperlink associated with image file, perform PDF files creation and manipulation with great stability. In this release, we have also improved the PDF form manipulation and the Flatten form fields feature is specifically improved. Furthermore, as a regular monthly release process, this version also includes fixes for issues reported in earlier release versions.

Get hyperlink associated with image in PDF file

Aspose.Pdf for Java supports the feature to Add Image in existing PDF document and also the feature to Add Hyperlink to PDF document. However there can be a scenario where an image already present inside PDF document points to a web URL and you may have a requirement to get hyperlink associated with image. Please note that links are represented as annotations in a PDF file and they can be added, updated or deleted. Furthermore, Aspose.Pdf for Java also supports getting the destination (URL) of hyperlink in a PDF file so in order to accomplish above mentioned requirement, we need to first search the images inside PDF document using following code snippet and then use the extracted rectangular coordinates to get the URL of LinkAnnotation from specific region.

// Open document
 Document doc = new Document("D:\\Tests\\input.pdf");
 // Create ImagePlacementAbsorber object to perform image placement search
 ImagePlacementAbsorber abs = new ImagePlacementAbsorber();
 // Accept the absorber for first page
 // Display image placement properties for all placements
 for (ImagePlacement imagePlacement : (Iterable)abs.getImagePlacements())
     System.out.println("image width:" + imagePlacement.getRectangle().getWidth());
     System.out.println("image height:" + imagePlacement.getRectangle().getHeight());
     System.out.println("image LLX:" + imagePlacement.getRectangle().getLLX());
     System.out.println("image LLY:" + imagePlacement.getRectangle().getLLY());
     System.out.println("image horizontal resolution:" + imagePlacement.getResolution().getX());
     System.out.println("image vertical resolution:" + imagePlacement.getResolution().getY());

Stable inter-file format conversion

In this release, we have specifically improved the inter file format conversion features, so PDF to DOC, PDF to PPTX, PDF to HTML and PDF to PDF/A have become more stable and robust as compared to earlier release versions. Some customers also reported incorrect rendering of Chinese text/content when PDF file is converted to HTML format. In some scenarios, the colors of images are also lost during PDF to HTML conversion and these scenarios are also fixed.

Miscellaneous fixes

As mentioned above, the tabular text alignment in resultant PPTX, missing notes in rendered PPTX, overlapping of text on table border during PDF to HTML conversion, splitting of text to multiple lines during PDF to PPTX conversion are also resolved. As it is always recommended to use latest release of our API’s, so we suggest you to please download the latest release of Aspose.Pdf for Java 17.7 and check Release Notes section regarding list of issues fixed in Aspose.Pdf for Java 17.7

To keep up with our news, you can follow us on Twitter or follow our Facebook page.

Leave a Reply