Copy link to clipboard
Copied
Hi ,
When adding an annotation, is it possible to get the selected text from that annotation ?
I am getting the text from getSelectedContent() on selection, but when highlighting getSelectedContent() is giving empty data.
Any help in this would be greatly appreciated!
Copy link to clipboard
Copied
You need to use getSelectedContent() after "PREVIEW_SELECTION_END" event is fired.
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
function(event) {
if (event.type === "PREVIEW_SELECTION_END") {
previewFilePromise.then(adobeViewer => {
adobeViewer.getAPIs().then(apis => {
apis.getSelectedContent()
.then(result => console.log(result));
});
});
}
}, {enableFilePreviewEvents: true}
);
Copy link to clipboard
Copied
this solution does not work on annotated text, works only on normal text selection.. any help to get the selected text from annotation ?
Copy link to clipboard
Copied
Note that the correct forum for posts about the PDF Embed API is https://community.adobe.com/t5/document-services-apis/ct-p/ct-Document-Cloud-SDK - using the wrong forum may cause long delays or no reply.