• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
14

Annotations duplicated on addAnnotationsInPDF function

Community Beginner ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

Since latest release today 13th of March using the pdfEmbedAPI

addAnnotationsInPDF

https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/howtos_comments/#addannota...

function results in the annotation added twice on any given PDF, issue happening on all browsers and accross operating systems (tested on Macos, Linux, Windows)

Every type of PDF is causing the issue and its consistent on both our application and the example repository provided by Adobe https://github.com/adobe/pdf-embed-api-samples

Code to replicate:
- Pull the latest release of the PDFEmbed api sample
- On https://github.com/adobe/pdf-embed-api-samples/blob/master/More%20Samples/React%20Samples/src/sample... override this function to delete and all back all markers

    onFileUpload = event => {
        event.persist();
        this.viewSDKClient.ready().then(() => {
            const files = event.target.files;
            if (files.length > 0 && this.isValidPDF(files[0])) {
                const fileName = files[0].name;
                const reader = new FileReader();
                reader.onloadend = e => {
                    const filePromise = Promise.resolve(e.target.result);
                    /* Helper function to render the file using PDF Embed API. */
                    viewSDKClient
                        .previewFileUsingFilePromise(
                        "pdf-div",
                        filePromise,
                        fileName,
                        previewConfig
                    )
                    .then((adobeViewer) => {
                    adobeViewer.getAnnotationManager().then((annotationManager) => {
                        annotationManager
                        .removeAnnotationsFromPDF()
                        .then((result) => {
                            annotationManager
                            .addAnnotationsInPDF(result["annotations"])
                            .then((result) => {
                                console.log(result);
                            })
                            .catch((error) => console.log(error));
                        })
                        .catch((error) => console.log(error));
                    });
                    });
                };
                reader.readAsArrayBuffer(files[0]);
            }
        });
    }

- Upload the provided PDF

- Make a simple change to trigger download
- Download new PDF with duplicated annotations

Provided screenshot of PDF opened on Adobe Acrobat PRO before and after as well as PDF to reproduce and with the issue

TOPICS
Bug , PDF Embed API , PDF Services API

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

I'm not sure about the demo code, but I've got a CodePen here - https://codepen.io/cfjedimaster/pen/zYJEMem?editors=1011 - that on annotations will dump out the annotations to the web page. If I do one, like a freehand draw, when the code that gets annotations is run, it only shows one. 

 

What are you seeing if you try my code?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

Ah I apologize, you are using the API to _add_ an annotation. Let me see if I can test this. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

So, I am not able to confirm that adding an annotation via the API returns 2 annotations. What I can confirm is that getting annotations, no matter how many, seems broken. 

 

https://codepen.io/cfjedimaster/pen/MWRjgzJ?editors=1111

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

Using the addAnnotation call generates the annotation twice but it won't show up until you download the PDF file

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

Thank you - in my CodePen above I added one comment and saw one comment. When I downloaded, I saw two comments. I'll be filing both reports now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

Ok thanks, can i get a tracking number/id for the bug, its heavily impacting our application

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

Nope, sorry. There is no public tracker for Embed issues, and currently no paid support options. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

there is no tracking number?  is there a potential ETA?  the release from today has this issue and is causing a major issue for us.........

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

is this issue getting treated as a CRITICAL for the new release?  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 13, 2024 Mar 13, 2024

Copy link to clipboard

Copied

LATEST

I'll ping the PM, that's all I can do for now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources