manoj sridhar
manoj sridhar

Reputation: 1

Is there a way to add Image using "saveIncremental" without invalidating previous signature

I'm currently trying to enable multiple users to sign PDF using Apache PDFBox.

My goal is to add images to a PDF incrementally without invalidating previous signatures. So far, I have successfully used form fields(text fields with signature fields) with lock dictionaries to continue saving using saveIncremental, which works fine. However, I want to use images instead of form fields.

I tried to insert images in following ways

Using Form Fields:

I used PDbutton form fields and updated their widgets to set images as appearances. This worked fine until the image size is same and fits within the button field itself. But the image width is greater than button field, In such cases, the image gets squashed into the original field size (in screenshot). Referenced from : https://github.com/mkl-public/testarea-pdfbox2/issues/18

squashed image

Expectation: I was expecting to update the button field dimensions to fit the image without invalidating the previous signature. However, resizing the button field seems to invalidate the signature.

Using Annotations:

I tried using annotations to save images (reference), which gives full control over the image dimensions. However, I'm not sure if these annotations are saved as part of the signature revision. Also, I'm concerned that these annotations can be edited or deleted after signing, which is not desirable.

Expectation: I want a way to ensure that annotations are locked and cannot be edited or deleted after signing, maintaining the integrity of the previous signatures.

=====================================================================

Questions:

**Is there some other way to achieve this? **I'm currently using PDFBox 2.0.28, but I'm open to switching to a different library if it supports this use case.

Or is the best solution to do this is to use form fields(text, checkbox, listfield ...) and use button fields when images that has fixed size?

Upvotes: 0

Views: 72

Answers (0)

Related Questions