HexaPDF 0.11.0 Published on
This minor release brings two new commands to the hexapdf
command line application, basic AcroForm
support and some other changes and fixes. It may break things, so please test before upgrading!
The possibly breaking change is the addition of the HexaPDF::PDFArray class. This new class is used for a similar purpose like HexaPDF::Dictionary and wraps arrays when they are indirect objects or when instructed to do so by dictionary field annotations. The main benefit is that references to indirect object are automatically resolved on access:
doc.pages[0][:Annots].each {|a| a = doc.deref(a); a.do_some_thing } # before
doc.pages[0][:Annots].each {|a| a.do_some_thing } # now
Since the new class doesn’t implement the whole Array interface existing code may need to be adapted!
The hexapdf
command line gains two new commands: One for watermarking/stamping a PDF onto another
and one for converting images to a PDF. The former is a standard operation implemented by many PDF
tools whereas the latter was added because many people ask about this on various forums.
Another addition under the hood is the basic AcroForm support by implementing the form, field and widget types. Not much can be done currently (finding form fields, querying basic information). However, it is planned to bring full AcroForm support with the next release! If you have any use cases that you want to see covered, please open an issue - thanks!
And as always, have a look at the changelog for an overview of all changes.