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

Annotation Selector is not valid for given xxx

Explorer ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

Hi, 

 

I've encountered this error when using 

annotationManager.addAnnotations(xxx);

 

tangyun_0-1606551786012.png

It was working for some time. then suddenly this error shows up. 

Views

2.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

correct answers 1 Correct answer

Community Beginner , Dec 02, 2020 Dec 02, 2020

This error encounters when the Comment is added to the File without selecting the selector

Votes

Translate

Translate
Community Beginner ,
Dec 02, 2020 Dec 02, 2020

Copy link to clipboard

Copied

This error encounters when the Comment is added to the File without selecting the selector

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
Explorer ,
Dec 02, 2020 Dec 02, 2020

Copy link to clipboard

Copied

Actually,

 

The annotation data are captured by adding event listeners for the event ANNOTATION_ADDED. 

 

This issue was solved by using the annotationManager.registerEventListener, instead of registering the event listener directly on the adobeViewer. 

 

Probably the event .d

it was solved by using the annotationManager to add the eventlistener for Annotation added. 

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
Explorer ,
Dec 02, 2020 Dec 02, 2020

Copy link to clipboard

Copied

seems one cannot edit the post once it's posted....

 

I meant probably because of the event.data content are different when captured by annotationManager compared to when captured by adobeViewer

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 ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

            annotationManager.registerEventListener(
                function (event) {
                    console.log(event);
                    if(event.type === "ANNOTATION_ADDED"){
                        annotationAdded(event);
                    }
                }
            );

This is how I am listening to the EventListener.
On annotationAdded(event) I am storing it locally .
and When I use the same annotation value to addAnnotations() that's when I get the Error 

 

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 ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

Thanks for using PDF Embed API. We are sorry for the inconvenience, could you please help us with the following information?

As tangyun said, "It was working for some time. then suddenly this error shows up.", are you trying to add the annotation to the same PDF from which annotation data was generated. Also, did annotation gets updated in between?

And for Dhruv5CCF query, is this happening each time for you, or for any particular PDF or annotation type or position?

Looking forward to helping you out.

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 ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

Hi Shubhanshu, I am getting the Error Message as - "Annotation selector is not valid for given XXXXX", 

Steps to reproduce it :

1. Open the Adobe PDF Dialog ( you will see the pdf get opened. )

2. Click on the coment dialogue on the top right corner , add some text to it and Click POST.

3. The Annotated data get saved in the database with success message.

4. Now when we are using the same data to be loaded with the below function as:

           annotationManager.addAnnotations(annotatedValue)
                .then(function () {
                    console.log("Annotations added through annotatedValue")
                })
                .catch(function (error) {
                    console.log(error)
            });
where "annotatedValue" contains the same data which is saved to the collection.
5. Throws an error - Annotation selector is not valid for given XXXXX
 
Screenshot is also attached.Annotate Issue 1.PNGAnnotate Issue 2.PNGAnnotate Issue 3.PNGAnnotate Issue 4.PNG

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 ,
Dec 03, 2020 Dec 03, 2020

Copy link to clipboard

Copied

Thanks, Dhruv for the information, we are experiencing this problem with Page Level Annotation for some PDFs. We are actively working on the fix and will be rolled out soon. Appreciate your patience on 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
New Here ,
Feb 16, 2021 Feb 16, 2021

Copy link to clipboard

Copied

Is there any update on this? I am receiving the same error when loading page level annotations or drawing annotations. Sticky notes are working.

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 ,
Feb 19, 2021 Feb 19, 2021

Copy link to clipboard

Copied

I have the same problem.  Works on some pdf files and fails on others.  Fails most of the time. 

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
Explorer ,
Sep 27, 2022 Sep 27, 2022

Copy link to clipboard

Copied

Good Day, was this problem ever solved? We are experiencing the same problem. 

 

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 ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

We are experiencing the same problem while updating annotation comment. Any updates on 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 ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

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 ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

But I dont see the solution to this issue. Can you please let know the solution.

Error:

code: 'FAIL', message: 'Annotation selector is not valid for given

 

Not quite sure what is wrong with the selector, bounding box, quad points all seem to be correct. Comments alone am not able to update when I select lines partially using textselection as I get the above error. This is a bit of emergency and would highly appreciate your quick response.

 

Thanks

Vasavi

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 ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

Right, if you check the thread, it's been identified as a real bug, and reported internally.  No solution yet.

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 ,
Oct 19, 2022 Oct 19, 2022

Copy link to clipboard

Copied

I was able to find a workaround for this issue. 

 

First thing this is an itermittent issue. 

 

code: 'FAIL', message: 'Annotation selector is not valid for given

 

we get the above error when the bounding box coordibates are incorrect. But the quad points have the right corrdinates. So the fix was to correct the bounding box coordinates based on the quad points. In my scenario I took the xmin, ymin and xmax,ymax from the quad points and updated the bouning box, Then the UpdateAnnotation api  started working perfectly!

 

Hope this helps

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
Explorer ,
Oct 20, 2022 Oct 20, 2022

Copy link to clipboard

Copied

@Vasavi244971977sns would you mind if I send you an example file of my annotations, and then you can share the correct co-ordinates so we can see your solution? See atatched sample (1).txt

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 ,
Oct 20, 2022 Oct 20, 2022

Copy link to clipboard

Copied

The below logic should help you update the bounding box . I am using quadpoints array and popupuating another array of x-cordinates and y-coordinates. After which bounding box is being updated with xmin,ymin and xmax,ymax.

 

Assuming annot is the object that you have shared....

 

 

var xcarray : Array<number> = [];
var ycarray : Array<number> = [];
var arrlength = event.data.target.selector.quadPoints.length;
var qpoints = event.data.target.selector.quadPoints;

for (var i =0 ; i< arrlength ; i++)
{
if (i % 2 ==0)
{
xcarray.push(qpoints[i]);
}
else
{
ycarray.push(qpoints[i]);
}
}

var xmin = Math.min.apply(Math, xcarray);
var ymin = Math.min.apply(Math, ycarray);
var xmax = Math.max.apply(null,xcarray);
var ymax = Math.max.apply(null,ycarray);
annot.target.selector.boundingBox[0] = xmin;
annot.target.selector.boundingBox[1] = ymin;
annot.target.selector.boundingBox[2] = xmax;
annot.target.selector.boundingBox[3] = ymax;

annotationManager.updateAnnotation(annot);

 

Please see if this helps

 

Thanks

Vasavi

 

 

 

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 ,
Oct 23, 2022 Oct 23, 2022

Copy link to clipboard

Copied

@Vasavi244971977sns Your solution works in my case. Thanks a lot!

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 29, 2023 Mar 29, 2023

Copy link to clipboard

Copied

LATEST

Was this ever resolved - we have the same error even 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