PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The node provides a "Protect PDF" operation that applies password protection and permission restrictions to a PDF document. It allows users to secure their PDF files by setting a password and defining what actions are permitted on the protected PDF, such as printing, copying, editing, commenting, and more.

This node is beneficial in scenarios where sensitive or confidential PDF documents need to be shared securely, ensuring only authorized users can access or modify the content. For example, a company might use this node to protect contracts before sending them to clients, or an educational institution could secure exam papers distributed digitally.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file to protect. Options: Binary Data (from previous node), Base64 String, URL to PDF file.
Input Binary Field Name of the binary property containing the PDF file (used when Input Data Type is Binary Data). Usually "data".
Base64 PDF Content Base64 encoded string representing the PDF content (used when Input Data Type is Base64 String).
PDF URL URL pointing to the PDF file to protect (used when Input Data Type is URL).
Output File Name Desired filename for the output protected PDF file. Default is "protected_output.pdf".
Password Password to apply to the PDF for protection. This password will be required to open the PDF.
PDF Permission Permissions allowed on the protected PDF. Options include: All, Print, Copy, Edit, Fill Forms, Comment, Assemble.
Binary Data Output Name Custom name for the binary data field in the node's output. Default is "data".

Output

The node outputs the protected PDF file as binary data under the specified binary data output name (default "data"). The output JSON contains metadata about the processed item, while the binary data holds the actual protected PDF file content ready for further processing or saving.

Dependencies

  • Requires an API key credential or authentication token to connect to the external PDF processing service.
  • The node depends on the external PDF4me API or similar service to perform the PDF protection operation.
  • Proper network access to fetch PDFs from URLs if the input type is URL.
  • No additional environment variables are explicitly required beyond standard n8n credentials setup.

Troubleshooting

  • Common Issues:

    • Providing an invalid or inaccessible URL when using URL input type may cause failures.
    • Incorrect base64 encoding of the PDF content can lead to errors during processing.
    • Using an incorrect binary property name when selecting binary data input will result in missing file errors.
    • Insufficient permissions or invalid API credentials will prevent the node from executing successfully.
  • Error Messages:

    • Errors related to "file not found" or "unable to fetch PDF" usually indicate issues with the input source.
    • Authentication errors suggest problems with the API key or credential configuration.
    • Permission-related errors may occur if unsupported permission options are selected or if the PDF is already encrypted.
  • Resolutions:

    • Verify the correctness and accessibility of URLs or binary fields.
    • Ensure base64 strings are properly encoded without extra characters.
    • Confirm API credentials are valid and have necessary permissions.
    • Check the PDF file is not corrupted or already locked with conflicting settings.

Links and References

Discussion