Set Default Font Name and Get All Fonts from PDF Document

Share on FacebookTweet about this on TwitterShare on LinkedIn

We at Aspose are glad to announce new release of Aspose.PDF for Java. Aspose.PDF for Java 18.5 is available on Aspose Artifactory for download. Since we always intend to provide an API with robust performance and usable features, we have introduced exciting features in our Java API by porting them from early release of .NET library. Furthermore, several bug fixes and performance improvements have also been made in this release of the API. A detailed overview of API improvements and changes has been given over the release notes page of Aspose.PDF for Java 18.5.

Set Default Font Name

Usually, Aspose.PDF for Java API used to replace fonts with default font, when specific fonts were not present or installed in the device where document was being generated. Therefore, we have investigated for a feasibility; if a font is used and embedded into the document, the output document should have same font – instead of being replaced by some default font. We have implemented this feature by introducing setDefaultFontName() method in PdfSaveOptions Class. An example with complete code snippet is also showcased in API documentation over following link:

Get all Fonts from PDF file

One of the excited features in Aspose.PDF for Java 18.5 is to get all fonts from PDF document programmatically. With this release of the API, you can get all fonts by using getAllFonts() method. An example with complete code snippet is given at following link of the API documentation:

Miscellaneous Fixes

Along with the features, which have been announced above, we have also fixed following reported bugs in this release of the API:

  • NullPointerException when saving PDF as HTML
  • Aspose.Pdf 18.4 throws exception “Incomplete private key – missing CRT.” when signing document with .pfx file
  • PDF to HTML: Extra space is being rendered with commos
  • Text goes beyond the page after replacing
  • PDF to HTML – Hyperlinks are removed in resultant file

As it is always recommended to use latest release of our API’s because they include latest features/improvements and fixes related to issues reported in earlier released versions. Therefore, please download the latest release of Aspose.PDF for Java 18.5.