Registercallback in Adobe DC View (SAVE_API)

New Here ,
Jun 28, 2020 Jun 28, 2020

Copy link to clipboard

Copied

Hi, 

I've got an error message when I put a callback with SAVE_API type.

 

Error message:

ViewSDKInterface.js:1 Uncaught TypeError: Cannot read property 'then' of undefined
at CallbackService._handleCallbackMessage (ViewSDKInterface.js:1)
at ViewSDKInterface.js:1
at Array.forEach (<anonymous>)
at MessagingService._receiveMessageHelper (ViewSDKInterface.js:1)

 

My code:

document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({
clientId: "<adobe_id>",
divId: "adobe-dc-view",
locale: "fr-FR",
 
});
adobeDCView.previewFile({
content:{
location: {url: "pdf/doc1.pdf"}
},
metaData:{fileName: "doc1.pdf"}
},
{
embedMode: "FULL_WINDOW",
defaultViewMode: "FIT_PAGE",
showDownloadPDF: true,
showPrintPDF: true,
showLeftHandPanel: false,
showAnnotationTools:true
});
 
const saveOptions = {
//
}
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.SAVE_API,
function(metadata, content, options) {
console.log(content)
}
);
});
 
Anybody have an idea what's wrong?
 
Thanks
TOPICS
View SDK

Views

272

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 ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

Hi, SAVE_API callback function needs to return a Promise. We will update our documentation for making it more apparent.

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 ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

LATEST

Hi.

Thanks for the tip it works great

 

 

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