简体   繁体   中英

display an encrypted pdf with java without typing the password

HI i searched this site and others for a answer. I need to display in a browser or acrobat reader for example a PDF with a password to open it . The case is I found some alternatives opening the file but copying it to other file to open it without protection. just need to pass the password via parameter to adobe reader or chrome to open the pdf. No copies to uncrypted file needed just opening the encrypted pdf to display the data to the final user. I'm using java Swing. Other valid alternative is displaying from JAVA with the valid password . I just need to display on screen the encrypted pdf Thanks for your answers.

You won't be able to accomplish your goal in any reasonably consistent way using the operating system or browser default PDF viewers. You'll need to use something like pdf.js which does support passing in a password. See below.

PDFJS.getDocument({ url: pdf_url, password: pdf_password })

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM