Skip to main content

Protect Document using n8n action

PDF4me Protect Document adds password protection and permission controls to PDF documents through n8n automation workflows. Process PDFs via n8n triggers, binary data, base64 strings, or public URLs to apply user/owner passwords, restrict permissions (printing, copying, editing, annotations), implement encryption levels (40-bit, 128-bit, 256-bit AES), and configure granular access controls for document security. This solution is ideal for confidential document protection, access control, compliance requirements, intellectual property protection, secure distribution, and automated PDF security workflows that require robust encryption with flexible permission management and seamless integration.

Setup

Add the PDF4me "Protect Document" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites:

  • PDF4me API credentials
  • n8n workflow access

Configuration:

  1. Add PDF4me node to workflow
  2. Select "Protect Document" action
  3. Configure input parameters (see below)
Protect Document

Parameters

Complete list of parameters for the Protect Document action. Configure these parameters to control document protection.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterTypeDescriptionExample
Input Data Type***StringPDF Input Format Selection
• Choose the format of your PDF data input
• PDF4me supports multiple input types
• Options: Binary Data, Base64 String, or URL
Binary Data
Input Binary FieldBinaryBinary PDF File Input (Required if Binary Data)
• Reference PDF file from previous n8n node or file upload
• PDF4me processes binary PDF files with automatic format detection
• Required when Input Data Type is "Binary Data"
{{ $binary.data }}
Base64 Document ContentStringBase64 Encoded PDF Input (Required if Base64 String)
• Provide PDF data as base64 encoded string
• PDF4me automatically decodes and processes the PDF content
• Required when Input Data Type is "Base64 String"
UEsDBBQABgAI...
File URLStringPublic PDF URL Input (Required if URL)
• Provide a public/open permission URL to the PDF file
• PDF4me downloads and processes the file from URL
• Required when Input Data Type is "URL"
https://abc.com/sample.pdf
Output File Name***StringProtected PDF Output Filename
• Specify the name for the generated protected PDF file
• Must include .pdf extension
• PDF4me ensures unique naming and format validation
protected_output.pdf
Password***StringDocument Password
• Set a secure password for the PDF document
• Password required to open and access the protected PDF
• Choose strong password for maximum security
SecurePassword123!
PDF Permission***StringDocument Permission Level
• Define the access permissions for the protected PDF
• Controls what users can do after entering password
• Options: All, Print, Copy, Edit, Fill Forms, Comment, Assemble
All
Binary Data Output Name***StringBinary Data Mapping
• Define the variable name for accessing generated protected PDF data
• Used in subsequent workflow actions
• Essential for workflow data flow
data

Advanced Options

The following parameters are available in the Advanced Options section and are optional:

ParameterTypeDescriptionExample
Custom ProfilesStringCustom Configuration Profiles
• Set additional options using custom profiles
• JSON-like format containing predefined parameters
• Supports outputDataFormat, preserveMetadata, etc.
• Optional for specialized requirements
{ "outputDataFormat": "json", "preserveMetadata": true, "optimizeForPrinting": false, "compressionLevel": "medium" }

Output

Output Parameters

ParameterTypeDescriptionExample
successBooleanPDF4me protection status indicator - Boolean flag indicating the success or failure of the PDF protection process. PDF4me returns true for successful operations and false for any errors, enabling robust error handling in automated workflowstrue
messageStringPDF4me protection status message - Human-readable status message providing details about the protection process result. Includes success confirmation or error details for troubleshootingPDF protected successfully
fileNameStringPDF4me generated PDF filename - The complete filename of the successfully generated protected PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processesprotected_output.pdf
mimeTypeStringPDF4me output MIME type - MIME type of the generated PDF file, always "application/pdf" for PDF documents. Useful for content type validation and proper file handling in web applicationsapplication/pdf
fileSizeNumberPDF4me PDF file size in bytes - The exact size of the generated protected PDF file in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation125430
docNameStringPDF4me document name reference - The name of the processed document for reference and tracking purposes. This matches the fileName for consistency in document management workflowsprotected_output.pdf
isProtectedBooleanPDF4me protection status confirmation - Boolean flag confirming that the PDF document has been successfully protected with password security. Useful for verifying that protection was applied correctlytrue
permissionLevelStringPDF4me permission level applied - The permission level that was successfully applied to the protected PDF document. Confirms the access restrictions that were configured during the protection operationAll

N8N Action Response

The PDF4me Protect Document API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

[
{
"success": true,
"message": "PDF protected successfully",
"fileName": "protected_output.pdf",
"mimeType": "application/pdf",
"fileSize": 125430,
"docName": "protected_output.pdf",
"isProtected": true,
"permissionLevel": "All"
}
]

Use Cases

Document Security and Compliance

  • Protect sensitive business documents with password encryption and access controls
  • Ensure compliance with data protection regulations and security standards
  • Secure confidential reports, contracts, and financial documents from unauthorized access

Enterprise Document Management

  • Automate document protection in business workflows and approval processes
  • Control access permissions for different user groups and departments
  • Implement security policies across large document repositories and archives

Content Distribution and Sharing

  • Protect intellectual property and proprietary content during distribution
  • Control how recipients can use shared documents (view-only, print restrictions)
  • Secure document sharing with external partners and clients while maintaining control

Get Help