How to password protect a pdf file ?

Deva393

Member
The task is to password protect a pdf file.
And if there are multiple files i need to zip it and password protect that file .
 

to_mas_re

New Member
Hi @Deva393 , @sandeep I have found solution, that works for me.

1. Download PDFSharp library (it is third party C# library - http://www.pdfsharp.net/ ). You can use this link - https://www.dllme.com/dll/files/pdfsharp_dll.html.
2. Copy the .dll file into this folder C:\Program Files\Blue Prism Limited\Blue Prism Automate\
3. Create object in BP. In Initialise action change Language (in Code Options) to C# and add External Reference "PdfSharp.dll". Also add Namespace Imports "PdfSharp.Pdf", "PdfSharp.Pdf.Security" and "PdfSharp.Pdf.IO". You can use PDFSharp for many things and Namespaces change accordingly.
4. Create Code Stage in Action where you put this code https://stackoverflow.com/questions/12383409/password-protecting-a-pdf-file. You need to change it for your purpose (for example input for the code stage needs to be 'filename' or password itself).

And that is it :)

Good luck!
 

Esom

New Member
If you have too many files to password protect, you'd better encrypt them in batches, which can prevent some files from being forgotten and save time.
A lot of third-party software can be found on Google to do this. Such as PDFCreator and PDF24 Creator.
 
Top