Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support editing already existing annotations #15403

Closed
ghost opened this issue Sep 6, 2022 · 5 comments · Fixed by #16523 or #16535
Closed

Support editing already existing annotations #15403

ghost opened this issue Sep 6, 2022 · 5 comments · Fixed by #16523 or #16535
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Sep 6, 2022

Attach (recommended) or Link to PDF file here:
dummy.pdf

Configuration:

  • Tested in firefox beta and nightly.
  • Microsoft Windows 10.
  • Whatever pdf.js version comes with firefox beta and nightly.
  • No, not an extension.

Steps to reproduce the problem:

  1. Add a text annotation (Same thing applies if you used the ink annotation, but for this example we shall just use the text annotation) to the attached dummy.pdf (It can be anything, like foo, bar, foobar, and whatever else you want)
  2. Save the PDF under a different name (It could be dummytwo.pdf it doesn't matter as long as its a separate file)

What is the expected behavior? (add screenshot)
I should be able to select the saved annotation (this issue applies to any PDF with saved annotations as well, not just made in pdf.js) and delete it or modify it further.
dummypdf

What went wrong?
I cannot delete it or edit it. As indicated by the screenshot, it acknowledges the existence of the annotation, but I can't delete it or modify it. I should be able to delete annotations or edit annotations made in pdf.js as well as any other PDF reader/writer that can make annotations.

@ghost ghost changed the title Cannot delete saved annotations. Cannot delete or further modify saved annotations. Sep 6, 2022
@ghost
Copy link
Author

ghost commented Sep 6, 2022

I should note that it's not just deleting I cannot do, but I cannot also modify saved annotations.

@marco-c marco-c changed the title Cannot delete or further modify saved annotations. Support editing already existing annotations Sep 7, 2022
@SebCorbin
Copy link
Contributor

The format from pdfPage.getAnnotations() is not the same as in pdfDocument.annotationStorage

After going through the source code, the AnnotationFactory.saveNewAnnotations() takes care of converting added annotations from annotationStorage to PDFAnnotation, but I see no way of doing the inverse through the current API.

@marco-c
Copy link
Contributor

marco-c commented Jun 10, 2023

Can be closed after #16525 is merged.

@DDHSchmidt
Copy link

If I read/tested this correctly this was implemented/corrected for text annotations exclusively.
Would it be possible to also enable this for ink annotations since PDF.js is also capable of editing those?

@marco-c
Copy link
Contributor

marco-c commented Aug 25, 2023

Presumably yes, could you file a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment