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

deleteAnnotation(...) not removing existing annotations in PDF #67

Open
melnikovic opened this issue Oct 24, 2022 · 1 comment
Open

Comments

@melnikovic
Copy link

Hi everyone,

I'm trying to delete the existing annotation from the PDF file.
I simply call this:

this.pdfFactory.deleteAnnotation(selectedAnnotation.id).then((x) => {
    this.pdfSrc = { data: this.pdfFactory.write() };
 });

If I call this method on annotation, which is not saved in PDF, everything works fine. However, if I call it on annotation which is in PDF it removes annotation from UI but when I call
this.pdfFactory.getAnnotations() I can still see annotation in list (is_deleted property is false) and when I save / download PDF I see annotation wasn't deleted from PDF file.

Am I doing something wrong or is this a bug?

@pacoMaldonado
Copy link

hi @melnikovic
I don't know if it still works for you, but when using the "deleteAnnotation" function, this returns an array with the "TextAnnotationObj" that we are going to delete. If you review the "TextAnnotationObj" object, you can see that there is an "AnnotationFactory" factory value in which there is a "data" attribute which is the pdf document in a format
Uint8Array which you load in your pdf viewer and you will notice that it no longer has the delete annotation.

P.D.
sorry my bad english

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

No branches or pull requests

2 participants