lopdf icon indicating copy to clipboard operation
lopdf copied to clipboard

Add Placeholder object type

Open wiomoc opened this issue 1 year ago • 1 comments

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

  1. the signature dictionary is created and linked to a corresponding form field. The entries ByteRange and Contents should each be set to a placeholder. The pdf is then written to a file, while taking into account the offsets of the placeholders
  2. the correct ByteRange is written to the offset observed by the placeholder object.
  3. 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.

wiomoc avatar Dec 29 '23 07:12 wiomoc

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().

J-F-Liu avatar Dec 29 '23 09:12 J-F-Liu