Skip to main content
Participant
March 12, 2021
Answered

Events not dispatched for top-level annotations due to error

  • March 12, 2021
  • 1 reply
  • 945 views

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.

This topic has been closed for replies.
Correct answer Sumona Ghosh

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!

 

1 reply

Sumona GhoshCorrect answer
Adobe Employee
March 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!

 

Raise5C07Author
Participant
March 15, 2021

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