0
New Here
,
/t5/acrobat-services-api-discussions/adobe-embed-not-saving/td-p/13118886
Aug 06, 2022
Aug 06, 2022
Copy link to clipboard
Copied
Hello! Just started using the Embed API. I am viewing a file from an DigitalOcean Spaces storage but when I save after marking it up, it doesn't update. Any help would be appreciated! Here is my code:
<!DOCTYPE html> {% load static %} <html lang="en"> <head> <meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="shortcut icon" href="{% static 'assets/images/favicon.png' %}" /> </head> <body style="margin: 0px"> <div id="adobe-dc-view"></div> <script src="https://documentcloud.adobe.com/view-sdk/viewer.js"></script> <script> var document_url = '{{ url }}'; var file_name = '{{ filename }}'; var read_only = {{ read_only }}; var adobe_key = '{{ adobe_embed_key }}'; const profile = { userProfile: { name: '{{ user.name }}', firstName: '{{ user.fname }}', lastName: '{{ user.lname }}', email: '{{ user.email }}' } }; const saveOptions = { autoSaveFrequency: 0, enableFocusPolling: false, showSaveButton: true }; </script> <script type="text/javascript" src="{% static 'assets/js/htw/adobe-embed.js' %}"></script> </body> </html>
Here is the JS:
document.addEventListener("adobe_dc_view_sdk.ready", function() {
var adobeDCView = new AdobeDC.View({
clientId: adobe_key,
divId: "adobe-dc-view"
});
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.SAVE_API,
function(metadata, content, options) {
return new Promise((resolve, reject) => {
resolve({
code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS,
data: {
metaData: { fileName: document_url }
}
});
});
}, saveOptions
);
adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.GET_USER_PROFILE_API,
function() {
return new Promise((resolve, reject) => {
resolve({
code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS,
data: profile
});
});
},
);
adobeDCView.previewFile({
content: {
location: {
url: document_url
}
},
metaData: {
fileName: file_name,
hasReadOnlyAccess: read_only
}
});
});
TOPICS
PDF Embed API
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Adobe Employee
,
Aug 08, 2022
Aug 08, 2022
Because you need to implement code to take the bits and save it yourself. We give you a hook to notice and customize the save process, but you have to actually handle doing it.
Adobe Employee
,
/t5/acrobat-services-api-discussions/adobe-embed-not-saving/m-p/13121724#M4568
Aug 08, 2022
Aug 08, 2022
Copy link to clipboard
Copied
Because you need to implement code to take the bits and save it yourself. We give you a hook to notice and customize the save process, but you have to actually handle doing it.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Joseph25523422w66n
AUTHOR
New Here
,
LATEST
/t5/acrobat-services-api-discussions/adobe-embed-not-saving/m-p/13121727#M4570
Aug 08, 2022
Aug 08, 2022
Copy link to clipboard
Copied
Yup, I realized that shortly after. Working now, thanks!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

