How to put password in PDF using Batch

Are there any tools or DLLs that can put a password in a PDF?

Example. I have 1000 pdf files. I want to put a password in every PDF file. Password will be different for each file.

-Regards, Ryl

+4
source share
2 answers

Using Gnostice PDFOne.NET, you can do it.

Just follow the link below. http://www.gnostice.com/goto.asp?id=28504&t=encrypt_documents_using_gnostice_pdfone_.net

Disclaimer: I work for Gnostis.

0
source

The Docotic.Pdf library can be used to protect PDF files with a password.

Here is a sample code for your task:

Dim filesToProcess As String() ' populate filesToProcess somehow For Each fileName As String In filesToProcess Using pdf As New PdfDocument(fileName) ' use OwnerPassword property if you need to protect file from being modified ' use UserPassword property if you need to protect file from being modified and from being viewed without knowing the password pdf.UserPassword = "password" ' there is also another supported encryption algorithms pdf.Encryption = PdfEncryptionAlgorithm.Aes128Bit Dim savePath As String = fileName & "encrypted.pdf" pdf.Save(savePath) End Using Next 

You can also set permissions for any protected PDF file.

Disclaimer: I work for a library provider.

0
source

Source: https://habr.com/ru/post/1398530/


All Articles