Events not dispatched for top-level annotations due to error

New Here ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

In the Adobe DC PDF View SDK, I'm experiencing an issue similar to this one in that top-level annotations of any kind will not be persisted. Commenting on particular parts of text will respond with that error, but no annotations besides replies will dispatch an ANNOTATION_ADDED event. ANNOTATION_COUNT does increase for text comments despite the error that displays.

 

I've isolated the failure - registering callbacks besides the following do not affect the presence of the error:

 

          previewFilePromise.then((adobeViewer) => {
            adobeViewer.getAnnotationManager().then((annotationManager) => {
              annotationManager.registerEventListener(function (event) {
                console.log(event.type, event.data)
              }, eventOptions)
            })
          })

 

 Here's the traceback, though it's cryptic due to the lack of sourcemaps:

 

Uncaught TypeError: t is undefined
    _validateMinLength https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2
    _validatePropertySource https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2
    _validateProperty https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2
    _validateObjectForKeyList https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2
    _validateObjectForKeyList https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2
    _validateObject https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2
    _validatePropertyTarget https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2
    _validateProperty https://documentcloud.adobe.com/view-sdk/2.15.0_2.1.0-45e9ffb/AdobeDCViewApp.js:2

 

I've attached the PDF I'm using for the benefit of testing.

TOPICS
PDF Embed API

Views

148

Likes

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

correct answers 1 Correct answer

Adobe Employee , Mar 12, 2021 Mar 12, 2021

HI, sorry for the inconvenience. Could you check if you are passing file ID in the metadata while invoking the previewFile API? When you enable the annotation APIs, you must pass a PDF ID in the metadata field to uniquely identify the PDF so that annotations can be added.

Let us know if this solves the issue. Thanks!

 

Likes

Translate

Translate
Adobe Employee ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

HI, sorry for the inconvenience. Could you check if you are passing file ID in the metadata while invoking the previewFile API? When you enable the annotation APIs, you must pass a PDF ID in the metadata field to uniquely identify the PDF so that annotations can be added.

Let us know if this solves the issue. Thanks!

 

Likes

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 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

LATEST

Adding the `id` field to the `metaData` object fixed my issue. Thanks for your prompt response!

Likes

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