lopdf
lopdf copied to clipboard
Add Placeholder object type
ISO 32000, so it should only be used in documents where post-processing is performed before the file is opened by a reader.
The intended use for this object is to sign a PDF document in three passes in accordance with ISO 32000-1 12.8.1, which behaves roughly as follows
- the signature dictionary is created and linked to a corresponding form field. The entries
ByteRange
andContents
should each be set to a placeholder. The pdf is then written to a file, while taking into account the offsets of the placeholders - the correct
ByteRange
is written to the offset observed by the placeholder object. - the signature is generated over the entire document with the exception of the 'Content' field. The generated signature is then written to the given offset, which is observed by the
Contents
placeholder object.
Placeholder
is not defined in the PDF specification, so add it to Object
enum is not appropriate. I prefer add a method to the writer such as write_placeholder()
.