PDF Generator API icon

PDF Generator API

Generate PDFs, manage templates, convert HTML/URLs to PDF, and perform PDF operations like watermarking, encryption, and optimization

PDF Service → Encrypt Document

AI-generated

Overview

This node operation encrypts an existing PDF document by applying password protection. It supports using a PDF from either a public URL or base64 encoded content as the source. Users can specify an owner password for full access and a user password for viewing restrictions. The encrypted PDF can be returned in various output formats including base64 JSON, binary file, or a download URL.

Use Case Examples

  1. Encrypt a PDF document fetched from a public URL with specified owner and user passwords, returning the encrypted PDF as a base64 string in JSON.
  2. Encrypt a base64 encoded PDF content with password protection and receive the encrypted file as a binary attachment for download.

Properties

Name Meaning
PDF Source Specifies the source of the PDF document to encrypt, either from a public URL or base64 encoded content.
PDF URL The public URL to the PDF document to be encrypted. Required if PDF Source is 'From URL'.
PDF Base64 The base64 encoded content of the PDF document to be encrypted. Required if PDF Source is 'From Base64'.
Output Format The format in which the encrypted PDF is returned: base64 JSON string, binary file data, or a download URL.
Owner Password Optional owner password granting full access to the encrypted PDF document.
User Password Optional user password required for viewing the encrypted PDF document.

Output

Binary

When output format is set to 'File (Binary)', the node outputs the encrypted PDF as binary data suitable for download or attachment.

JSON

  • success - Indicates if the encryption operation was successful.
  • operation - The operation performed, which is 'encrypt'.
  • filename - The name of the encrypted PDF file when output as binary.
  • format - The output format chosen for the encrypted PDF.
  • fileSize - The size of the encrypted PDF file in bytes.
  • ``
    • *
      * `` - Additional properties returned by the API such as base64 string or download URL depending on output format.

Dependencies

  • An API key credential for the PDF Generator API service is required to authenticate requests.

Troubleshooting

  • Ensure the PDF source is correctly specified and the corresponding input (URL or base64 content) is provided and valid.
  • Passwords should be provided as strings; empty passwords are allowed but may reduce security.
  • If the output format is 'File (Binary)', ensure the workflow consuming this node can handle binary data.
  • Common errors include invalid PDF content, missing required parameters, or authentication failures with the API. Verify credentials and input data format.

Discussion