File Preview Events no longer firing
Hello,
Are there any possible reasons, why FilePreviewEvents are no longer firing?
We registered the 2 callbacks below, the PDFAnalyticsEvents are firing but not the FilePreviewEvents.
This is working before, but we don't what has changed. We don't get any javascript errors on the browser console.
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
function (event) {
alert.log("Event: " + event.type);
if (event.type === "PREVIEW_SELECTION_END") {
previewFilePromise.then(adobeViewer => {
adobeViewer.getAPIs().then(apis => {
apis.getSelectedContent()
.then(result => {
selectedText = result.data;
console.log("selectedText = " + selectedText);
})
.catch(error => console.log(error));
});
});
}
}, {
enableFilePreviewEvents: true
}
);
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
function (event) {
alert("event", event);
var copiedText = event.data.copiedText;
var frame = document.querySelector('#propIFrame');
if (frame && frame.contentWindow) {
var selectedField = frame.contentWindow.lastFocusedField;
if (selectedField && /(input|select|textarea)/i.test(selectedField.nodeName)) {
selectedField.value = copiedText;
}
}
}, {
//Pass the PDF analytics events to receive.
//If no event is passed in listenOn, then all PDF analytics events will be received.
listenOn: [AdobeDC.View.Enum.PDFAnalyticsEvents.TEXT_COPY],
enablePDFAnalytics: true
}
);
