Which product are you using?
PDF.js Express Viewer : 8.7.0
Detailed description of issue
I’m able to view a password-protected PDF fine by supplying the password in loadDocument. I’ve updated my downloadButton element to allow a user to download the decrypted PDF, but the downloaded file is still encrypted.
Expected behaviour
When a user is viewing the decrypted pdf and click download, I want them to be able to view the downloaded file without entering the password.
Does your issue happen with every document, or just one?
All password-protected PDFs are affected.
Code snippet
//Load document (working fine):
instance.UI.loadDocument(pdf, {
filename: “test.pdf”,
password: password,
});
// Download encrypted PDF
const options = {
document: pdf,
filename: “downloaded.pdf”,
password: password,
flags: instance.Core.SaveOptions.LINEARIZED,
downloadType: “pdf”,
};
instance.updateElement(‘downloadButton’, {
onClick: () => {
console.log(‘test options’, options);
instance.UI.downloadPdf(options);
}
})
});