This article explains how to update an existing PDF directly from the Document Mapping screen in Salesforce. Users can add or remove PDF form fields, save the updated PDF in place, and keep existing content and mappings intact without downloading and re-uploading the file.
📘 Instructions
-
Log in to Salesforce.
-
Open the Document Templates tab or the Document Template object.
-
Open an existing Document Template or create a new one.
-
Upload or select a PDF document if one is not already attached.
-
Open the Document Mapping section.
-
Add new form fields from the PDF toolbar.
-
Map the new PDF form fields to the required Salesforce fields.
-
Click Update Document in the PDF toolbar.
-
The updated PDF is saved and reloaded automatically.
Use Update Document only after adding or deleting PDF form fields. The button stays disabled until a form field change is detected.
What changed
-
Update Document button: Added to the PDF toolbar.
-
Button state: Disabled until a PDF form field is added or deleted.
-
Field highlighting: Newly added fields are highlighted until the document is updated.
-
Save behavior: Temporary highlighting is removed before saving, so it is not stored in the final PDF.
-
Delete behavior: Deleting a PDF form field also deletes its related document mapping and removes it from the mapping list.
-
Storage flow: The updated PDF is exported as Base64 from the Visualforce page, sent to the LWC, and saved as a new Salesforce
ContentVersion. -
Data preservation: Existing document content and existing field mappings remain unchanged.
-
Session protection: Each document editor session uses a unique session identifier so Base64 data from a previously opened PDF cannot be reused when another PDF is open in the Salesforce single-page application.
📋 Related articles
-
Document Template setup and configuration
-
Document Mapping field configuration
-
PDF form field mapping in Salesforce