Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

All Digital Signature info goes missing after adding annotations #76

Open
aashishvanand opened this issue Jun 22, 2021 · 2 comments
Open

Comments

@aashishvanand
Copy link

Hi,
I have an existing PDF that is digitally signed. I wanted to add some basic annotations.
Let's say I have added a simple square as per the code below and then I save the PDF all the signature info is lost.
Probably the best way to do it by supporting incremental updates to the pdf. I am not sure if pdf-annotate supports that

from pdf_annotate import PdfAnnotator, Location, Appearance
a = PdfAnnotator('input_signed.pdf')
a.add_annotation(
'square',
Location(x1=50, y1=50, x2=100, y2=100, page=0),
Appearance(stroke_color=(1, 0, 0), stroke_width=5),
)
a.write('output.pdf')

@pulse-mind
Copy link

pulse-mind commented Dec 9, 2022

Hi, it is because you modify the file and the part of the file that contains the signature when you are doing the write(...).
You need to do an "incremental save" but I'm not sure "pdf-annotate" has this feature.
@aashishvanand did you find another solution ?

@santi2491
Copy link

Does anyone have a solution to this problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@aashishvanand @pulse-mind @santi2491 and others