---
title: Dynamic PDF Passwords
description: PDF Butler provides an option to add password protection to your generated PDF documents. You can add those passwords dynamically by creating some formula fields in Salesforce object. You can go through the video for more information on how to…
url: "https://pdfbutler.com/academy/pdf-butler-academy/pdf-butler-tips-tricks/dynamic-pdf-passwords/"
updated: "2025-09-02"
category: "PDF BUTLER TIPS & TRICKS"
---

# Dynamic PDF Passwords

PDF Butler provides an option to add password protection to your generated PDF documents. You can add those passwords dynamically by creating some formula fields in Salesforce object. You can go through the video for more information on how to set this up.

[SINGLE ConfigTypev1](https://www.youtube.com/embed/K5hpNw0JzuA)

###### Example:

Let's say, you want to add dynamic password protection to your PDF Document with password in below format.

ContactFirstNameLastName(lowercase)DOB(ddmmyy)

1. Create a formula field on Contact Object which stores the password in above format.
    ![Dynamic Password for PDF Pic3](https://pdfbutler.com/wp-content/uploads/2025/09/Dynamic-Password-for-PDF-Pic3.png)
2. Create a Data Source which will fetch the above formula field. In this example, I have a custom object called Custom Invoice. On that object I have a lookup to Contact record. So Query the contact lookup formula field.
    ![Dynamic Password for PDF Pic2](https://pdfbutler.com/wp-content/uploads/2025/09/Dynamic-Password-for-PDF-Pic2.png)
3. Go to any Doc Config for which you want to add password protection to the document or create a Doc Config.
    ![Dynamic Password for PDF Pic1](https://pdfbutler.com/wp-content/uploads/2025/09/Dynamic-Password-for-PDF-Pic1.png)
    Open PDF Butler, add the Data Source which you have created. Go to Doc Config metadata section and you will find below setting. Enable it and map the formula field as shown below.
    ![Dynamic Password for PDF Pic5](https://pdfbutler.com/wp-content/uploads/2025/09/Dynamic-Password-for-PDF-Pic5.png)
4. Now go to Custom Invoice record, add the Doc config to the pade and generate the PDF. As we enabled password protection, PDF Butler previewer will ask for the password. Also downloaded PDF will ask for password.
    ![Dynamic Password for PDF Pic4](https://pdfbutler.com/wp-content/uploads/2025/09/Dynamic-Password-for-PDF-Pic4.png)

 
