Skip to main content
gedsmurf1
Known Participant
September 15, 2021
Question

Bypass Password Dialog for protected files in PDF embed api

  • September 15, 2021
  • 2 replies
  • 699 views

 

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,

    This topic has been closed for replies.

    2 replies

    Legend
    September 15, 2021

    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?