Copy link to clipboard
Copied
https://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
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?
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
...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
Copy link to clipboard
Copied
When I use:
await annotationManager.selectAnnotation(result[0].id);
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?
Copy link to clipboard
Copied
Screenshots of annotations:
https://community.adobe.com/t5/document-services-apis/pdf-embed-api-get-screenshot/m-p/11428290?page...
And more precisely this:
https://community.adobe.com/t5/document-services-apis/how-disable-scrollbar-when-embedmode-quot-full...
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!
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
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...
Copy link to clipboard
Copied
I think i found a workaround, i also tested it both on desktop & ipad resolution, not actual device:
Pay attension to screenHeightInch calculation instead of hardcoded 11 inch
With this func u can get the PPI:
export const getPPI = () => {
const div = document.createElement('div');
div.style.width='1in';
const body = document.getElementsByTagName('body')[0];
body.appendChild(div);
const ppi = document.defaultView.getComputedStyle(div, null).getPropertyValue('width');
body.removeChild(div);
return parseFloat(ppi);
};
Usage to with goToLocation:
const PDFCoordinatePPI = 72;
const screenHeightInch = Math.round(screen.height / getPPI());
const page = parseInt(annotation.target.selector.node.index, 10) + 1;
const xCoordinate = parseInt(annotation.target.selector.boundingBox[0], 10);
const yCoordinate = (screenHeightInch * PDFCoordinatePPI) - parseInt(annotation.target.selector.boundingBox[3], 10);
apis.gotoLocation(page, xCoordinate, yCoordinate)
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.
Copy link to clipboard
Copied
Hello,
anyone know how to get highlighted text using any one of below
actually, i want a highlighted text with a comment added by the user. I got all comment using this method
Copy link to clipboard
Copied
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.