Bypass Password Dialog for protected files in PDF embed api
Copy link to clipboard
Copied
Hello,
Is there a way to bypass the password dialog when opening a password protected file.
Here is our use case, we are trying to render pdf to the client using the Adobe Embed API before sending them the pdf binary we applied watermarks onto it. For protected files, we let them enter the password first, then we do the watermarking from the severside and then send back the watermarked content.
We already asked from them the password and we just want to use it instead of asking them twice.
We already tried passing it on adobeDCView.previewFile parameter as the password, content.password, content.location.password and metaData.password but no luck.
document.addEventListener("adobe_dc_view_sdk.ready", function()
{
var adobeDCView = new AdobeDC.View({clientId: "<YOUR_CLIENT_ID>", divId: "adobe-dc-view"});
adobeDCView.previewFile(
{
content: {
location: {
url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf"}
},
password: "secret",
metaData: {fileName: "Bodea Brochure.pdf"}
});
});
Thanks,
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I think your code amply demonstrated why this should not be a feature. Because the password is going to be there for the taking in the JavaScript code... but let me give you the link to the forum where the PDF Embed specialists hang out... https://community.adobe.com/t5/document-services-apis/ct-p/ct-Document-Cloud-SDK?

