Copy link to clipboard
Copied
Hi,
I've encountered this error when using
annotationManager.addAnnotations(xxx);
It was working for some time. then suddenly this error shows up.
This error encounters when the Comment is added to the File without selecting the selector
Copy link to clipboard
Copied
This error encounters when the Comment is added to the File without selecting the selector
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.
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
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
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.
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:
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.
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.
Copy link to clipboard
Copied
I have the same problem. Works on some pdf files and fails on others. Fails most of the time.
Copy link to clipboard
Copied
Good Day, was this problem ever solved? We are experiencing the same problem.
Copy link to clipboard
Copied
We are experiencing the same problem while updating annotation comment. Any updates on this ?
Copy link to clipboard
Copied
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
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.
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
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
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
Copy link to clipboard
Copied
@Vasavi244971977sns Your solution works in my case. Thanks a lot!
Copy link to clipboard
Copied
Was this ever resolved - we have the same error even now