Encrypted PDFs

Encrypted PDFs

Forum member · Mar 2, 2010
Hello, Is the DynamicPDFViewer 2.x able to open and display an encrypted PDF (given the proper password of course)? Is the password entry window native to the DynamicPDFViewer or would that have to be written by the client and then pass the password to DynamicPDFViewer as the file is being opened? Thanks!

Re: Encrypted PDFs

Support · Mar 2, 2010
Hello, You can open encrypted PDF documents using DynamicPDF Viewer without any problem. The password required for opening the PDF document needs to be specified in the OpenFile method of the DynamicPDFViewer object through code. Below is the sample line of code: pdfViewer.OpenFile(fileDialog.FileName, "owner"); // owner is the password requried to open the PDF customer selects Thanks, ceTe Software Support Team

Re: Encrypted PDFs

Forum member · Mar 2, 2010
How does the PDF Viewer know whether the file is encrypted or not? If the user chooses to randomly open a file that is passworded pdfViewer.OpenFile() only returns a generic false and doesnt open the file. Does pdfviewer have a way to detect or know that there is a password and respond accordingly? Can it return an exception of some sort so that the program knows the file was password protected?

Re: Encrypted PDFs

Support · Mar 3, 2010
Hello, Currently it is not possible to find out if the PDF is encrypted using the Viewer product. In order to open the PDF you will have to use the password. If you do not give the password it will not open the PDF. Thanks, ceTe Software Support Team.