Copy link to clipboard
Copied
using light box option ... seems to me that would open on top of whatever page it was triggered from
there are options: "return" and "close" but neither return to triggering page
i want to open new api geneterated page and when closed, return to:
where it was opened from
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks for using PDF Embed API, you can listen for the event PDF_VIEWER_CLOSE and do the needful on your own.
To know more about this please see https://www.adobe.com/devnet-docs/dcsdk_io/viewSDK/howtodata.html#basic-events
Copy link to clipboard
Copied
hmmm... after trying to make sense of all that on the page you linked, made me realize it is far more complicated than i thought the code on the page does already have "addEventListener"
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: "bf32026bc4ba4ca08bd828108abb5aa7"});
adobeDCView.previewFile({
content: {location: {url: "http://www.bigopera.com/adobePDF/11.19.2020x"}},
metaData:{fileName: "table 11 19 2020"}
}, {embedMode: "LIGHT_BOX", defaultViewMode: "FIT_PAGE", dockPageControls: true, showDownloadPDF: false, showPrintPDF: false, exitPDFViewerType: "CLOSE"});
});
</script>
Copy link to clipboard
Copied
As described in the documentation, you need to register a callback for listening events from PDF Embed API. I have drafted a sample for you.
const eventOptions = {
listenOn: [ AdobeDC.View.Enum.Events.PDF_VIEWER_CLOSE ],
}
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
function(event) {
// Do the needful here, redirect to your desired webpage
}, eventOptions
);
Hope this helps your cause.