In this guide you’ll learn how to automatically apply security settings to a PDF using Power Automate. With the Muhimbi PDF Converter you can create Flows that automatically add password protection, disabling printing and prevent text copying in your PDF documents.
Key security features:
- Apply security to MS Word, MS Excel, MS PowerPoint and PDF Files.
- Apply security after user specific watermarks have been applied.
- Apply typical PDF Security including Open Password and Owner Password.
- Prevent Printing, Prevent Text Copy, Prevent Document assembly.
It’s also important to note that in this example we are using Power Automate to secure a PDF in SharePoint. You can easily add security to your PDF file in another destination like Dropbox, Google Drive, OneDrive, or any platform supported by Power Automate. You can also extend our example by adding additional automation like sending the secure PDF as email.
Prerequisites:
Ensure the following prerequisites are in place:
- An Office 365 subscription with a SharePoint Online license.
- Muhimbi PDF Converter for Power Automate full subscription.
Note: Free version does not support this functionality. - Appropriate privileges to create Flows.
- Working knowledge of SharePoint Online and Microsoft Power Automate (Flow).
Securing Documents Using Power Automate:
Please note that this example is a snippet of how you can use this feature. When implementing in your live environment, please ensure necessary additional columns and MS Flow steps are added to prevent the Flow from recursively triggering. From a high level, the flow will look as follows:
To secure a document in MS SharePoint, perform the following steps:
Create a new Flow and use the SharePoint Online trigger ‘When a file is created (properties only)’. Select the URL for the Site Address and select the relevant Library Name and Folder for the trigger.
Insert a ‘Get file content’ action to get the details of the file. Select the URL for the Site Address and for File Identifier, select the ‘ID’ which is the output of ‘When a file is created (properties only)’ trigger.
Insert Muhimbi's ‘Secure document’ action and fill it out as per the screenshot displayed below:
- Source Filename: Add ‘File Content’ which is the output of the ‘Get file content’ SharePoint Action.
- Open Password: An optional password that you can enter in order to open the document.
Note: Any password entered here is displayed in clear text, to allow Power Automate action field references to be added. - Owner Password: An optional password that you can enter in order to change the PDF restrictions. When specifying any PDF Restrictions then this password must be set.
Note: Any password entered here is displayed in clear text to allow Power Automate action references to be added. - PDF Restrictions: One or more restrictions to apply to the PDF file, separated by a pipe ‘|’ character . By default it applies all restrictions (Print|HighResolutionPrint|ContentCopy|Annotations|FormFields|ContentAccessibility|DocumentAssembly), but any combination is allowed. You can enter the word ‘Nothing’ to not apply any restrictions. In order to activate these settings you must supply an owner password.
Insert a ‘Create File’ action to write the file generated by ‘Secure Document’ action back to MS SharePoint Online. Select the URL for the Site Address and select the relevant Folder path where you want the secure document to be saved. For File Name, select the ‘Base file name’ and for ‘File Content’ select the ‘Processed file content’ both of which are the output of ‘Secure Document’ action.
5) Publish the workflow and upload a PDF file in the source library. After a few seconds, the Flow will trigger and a secure PDF file will be generated in the target library.