Skip to main content
Participating Frequently
February 24, 2022
Question

PDF Embed API AddAnnotationsInPdf()

  • February 24, 2022
  • 1 reply
  • 1740 views
Hi I'm currently using the PDF Embed API and I'm adding a hundred of shape annotations to a PDF (with a single addAnnotationsInPDF() call)  and it adds all the annotations visually, then adds one annotation at a time very slowly, that I can see following the triggered events and during this action it locks the application screen and take several minutes to complete. This makes the viewer barely usable for my application...
 
A JSON example of an annotation that is added:
{
    "@context": [
    ],
    "id""a3e2414b-1cef-4c4b-8447-1d143b42a79a",
    "type""Annotation",
    "motivation""commenting",
    "bodyValue""-",
    "target": {
        "source": "17",
        "selector": {
            "node": {
                "index": 0
            },
            "opacity": 0.4,
            "subtype": "shape",
            "boundingBox": [
                66,
                731.9199829101562,
                326,
                740.9199829101562
            ],
            "inkList": [
                [
                    66,
                    731.9199829101562,
                    326,
                    731.9199829101562
                ],
                [
                    326,
                    731.9199829101562,
                    326,
                    740.9199829101562
                ],
                [
                    326,
                    740.9199829101562,
                    66,
                    740.9199829101562
                ],
                [
                    66,
                    740.9199829101562,
                    66,
                    731.9199829101562
                ]
            ],
            "strokeColor": "#b80000",
            "strokeWidth": 3,
            "type": "AdobeAnnoSelector"
        }
    },
    "creator": {
        "name": "Beatriz P.",
        "type": "Person"
    },
    "created""2022-02-21T15:51:25Z",
    "modified""2022-02-21T15:51:25Z"
}
This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
February 24, 2022

Please share your code.

Participating Frequently
March 4, 2022

It's a single call to AddAnnotationsInPdf with an array with more than 100 annotations like this one:

{
    "@context": [
    ],
    "id""a3e2414b-1cef-4c4b-8447-1d143b42a79a",
    "type""Annotation",
    "motivation""commenting",
    "bodyValue""-",
    "target": {
        "source": "17",
        "selector": {
            "node": {
                "index": 0
            },
            "opacity": 0.4,
            "subtype": "shape",
            "boundingBox": [
                66,
                731.9199829101562,
                326,
                740.9199829101562
            ],
            "inkList": [
                [
                    66,
                    731.9199829101562,
                    326,
                    731.9199829101562
                ],
                [
                    326,
                    731.9199829101562,
                    326,
                    740.9199829101562
                ],
                [
                    326,
                    740.9199829101562,
                    66,
                    740.9199829101562
                ],
                [
                    66,
                    740.9199829101562,
                    66,
                    731.9199829101562
                ]
            ],
            "strokeColor": "#b80000",
            "strokeWidth": 3,
            "type": "AdobeAnnoSelector"
        }
    },
    "creator": {
        "name": "Beatriz P.",
        "type": "Person"
    },
    "created""2022-02-21T15:51:25Z",
    "modified""2022-02-21T15:51:25Z"
}
Adobe Employee
March 4, 2022

Are you listening for any annotation events?