selector.boundingBox and selector.quadPoints - What do they mean, what is the point of reference?

Explorer ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

Screenshot_2020-09-23 Comments and Markup — Document Cloud View SDK.pnghttps://www.adobe.com/devnet-docs/dcsdk_io/viewSDK/howtos_comments.html#annotation-schema

 

`selector.boundingBox` and `selector.quadPoints` - What do they mean, what is the point of reference?

 

When I use them in

await apis.gotoLocation(pageNumber, 0, here);
 

I can't hit with an annotation position.

I want the top edge of the viewer to be flush with the top of the annotation.

 

How to do it?

TOPICS
How to, PDF Embed API

Views

262

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 Community Professional , Sep 24, 2020 Sep 24, 2020
Is this CodePen showing the behavior you were looking for? The PDF coordinate system is based on 72 points per inch. In order to make a selected annotation scroll to the top of the window, you need to know the page size but there's no API to get it at this time. You have to know it ahead of time but it's fairly simple to preprocess the PDF and add that information to a metadata field that you can access via Embed API. An 11 inch tall page is 792 points high. You then calculate the Y_Coordinate p...

Likes

Translate

Translate
Adobe Employee ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

Hi, 
`selector.boundingBox` and `selector.quadPoints` are referred according to the PDF coordinate system, which is different from the View one which you are seeing.
For your use-case,  I would request you to use selectAnnotation API listed under https://www.adobe.com/devnet-docs/dcsdk_io/viewSDK/howtos_comments.html#apis-to-control-ui-configura... 

Thanks,
Shubhanshu

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
Explorer ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

When I use:

 

await annotationManager.selectAnnotation(result[0].id);

 

it does not move as I want, but to the edge of the document page.
 
I need to know what position the annotation is in, for example iframe with document viewer.

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
Adobe Employee ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

Yes, this API is intended to select the annotation and shift the focus by bringing it back to the view if not.

Can you please tell us more about what you are trying to achieve?

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
Explorer ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

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
Explorer ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

Conclusions:

`y` are correct if you increase them by 1/3. Similar error here: https://community.adobe.com/t5/document-services-apis/how-get-page-width-and-height/m-p/11451327#M70...

`x` are not valid or partially valid - unable to match the annotation position with what is contained in `selector.boundingBox` and` selector.quadPoints`.

 

So these are bugs of this API!

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
Adobe Employee ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

Sorry, but your assumptions are not correct. As I mentioned you are mixing two different coordinate systems and making assumptions like increase by 1/3.

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
Explorer ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

Maybe about selector.boundingBox and selector.quadPoints.


But when it comes to zoom, there's something wrong there. The PDF document I'm using is set to 75% true size when.

`await apis.getPageZoom(1)` returns 1 when the document displays at 75% of its size.

I wrote about it here:
https://community.adobe.com/t5/document-services-apis/how-get-page-width-and-height/m-p/11451327#M70...

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
Adobe Community Professional ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

Is this CodePen showing the behavior you were looking for?

The PDF coordinate system is based on 72 points per inch. In order to make a selected annotation scroll to the top of the window, you need to know the page size but there's no API to get it at this time. You have to know it ahead of time but it's fairly simple to preprocess the PDF and add that information to a metadata field that you can access via Embed API. An 11 inch tall page is 792 points high. You then calculate the Y_Coordinate position for gotoLocation by subtracting the 4th item in the bounding box from the page height.

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 ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

Hello,
anyone know how to get highlighted text using any one of below 
Capture.PNG

 

actually, i want a highlighted text with a comment added by the user. I got all comment using this method 

 annotationManager.getAnnotations() but i can not get the highlighted text. i got value of boundbox and quadpoints. have you any idea about this ?

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
Adobe Community Professional ,
Jan 19, 2021 Jan 19, 2021

Copy link to clipboard

Copied

LATEST

Embed API does not currently have any methods of retrieving the text within a given bounding box or list of quads. You can, however, use these input values for another API that can parse PDF.

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