BFO PDF Library 2.29
Release 2.29 of our PDF Library brings a number of improvements and changes across the API. A summary of them is listed here.
PDF/A validation and Metadata
Our profiles for PDF/A-1 through to PDF/A-4 have gone through another round of compatibility testing against some other PDF/A validators, with a few minor bugs squashed, a few adjustments made to bring them closer in line with other validators, and a number of clarifying resolutions from the PDF/A Technical Working Group (of which bfo.com is a member) applied.
One of the resolutions concerns a detail of schema extensions, used for defining custom properties in XMP metadata for PDF/A-1, PDF/A-2 and PDF/A-3. The resolution concerning "type scope" has required a fairly significant rewrite to our XMP code. If you're working with one of these PDF/A profiles this may affect you in one of two ways:
- Documents using a small subset of XMP properties that were previously validated (or converted to) PDF/A-1, A-2 or A-3 using BFO APIs may no longer be considered valid.
- On the API side, calling XMP.getType() to retrieve a type defined in an extension schema (loaded in or newly created) will return null. The new XMP.Schema.getType() method should be called instead to retrieve it from the appropriate Schema.
PDF/A-4 isn't affected as it uses RelaxNG schemas for validation (which we can generate on-the-fly if required, and there have been some fixes here too). We've also added metadata support for the brand-new EA-PDF v1.0 specification, released by the PDF Assocation just last month.
Amazon CloudHSM v5 API changes
We have a few customers digitally signing PDF using the Amazon CloudHSM service. Version
3 of their API
is being disabled at the end of this month, and the replacement version 5 has a slight
change which was
breaking signing in some workflows. If signing is throwing a
com.amazonaws.cloudhsm.jce.jni.exception.FailedLoginException, it may be necessary to call
AcrobatSignatureHandlerFactory.setLoginToAuthProvider(false) on your Signature Handler factory. Amazon's API throws this
exception if a Provider that is already logged in tries to log in again - setting
this flag will stop our
API from trying.
Measurement API for Geospatial PDF
A new Measurement class supports both rectilinear and geospatial measurements on the PDF page, providing a very simple API to use what can be a very complex set of features. Methods are available to convert between "page" and "measurement" units in both directions, and support for GeoTIFF images (including 16-bit images) has been added.
There is a lot of mathematics required when dealing with map projections, and the BFO PDF Library
relies
on the GeoTools API for this. If GeoTools is in the CLASSPATH, it is used
to convert between page measurements and map measurements - if it's not, the measurement
objects are still available
and can be described, but any conversions return null.
A later blog article will go into more detail on this, but we're pleased to be able to offer an alternative to GDAL for Geospatial PDF.
Bugfixes and tweaks
Of course there is the usual slew of minor bugfixes and tweaks. Many have come from the upcoming support for EA-PDF in BFO Publisher, which we're hoping to announce in the next month or two.
Two fixes to the way superscript and subscript are positioned means this upgrade is an important for anyone using the PDF API to directly create superscript or subscript text - if that's you, don't skip this upgrade.
Finally, there have been several fixes to the print-preview rendering which have fixed a few interesting edge-cases. Again, if you're using this feature, please upgrade.
All the changes are detailed in the Release Notes. Version 2.29 is available for download now at bfo.com/download.