0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

PDF → Manage PDF Metadata

AI-generated

Overview

This node provides utilities to manage PDF metadata, allowing users to either retrieve existing metadata from a PDF or edit and update the metadata fields. It supports working with PDFs accessible via a public URL or provided as binary buffer data. Users can choose to get the updated PDF as a downloadable URL or as binary data.

Common scenarios include:

  • Extracting metadata information such as title, author, subject, and keywords from a PDF for cataloging or indexing.
  • Updating PDF metadata to reflect new document details before distribution or archival.
  • Automating metadata management workflows in document processing pipelines.

Practical example:

  • A user wants to update the author and add keywords to a PDF stored online. They provide the PDF URL, specify the new author and keywords, and receive the updated PDF as a downloadable link.

Properties

Name Meaning
Metadata Operation Choose between "Edit Metadata" (to update PDF metadata) or "Get Metadata" (to retrieve metadata).
PDF URL Public URL of the PDF file to process.
PDF Buffer Binary buffer data of the PDF file to process instead of using a URL.
Return as URL Boolean option to return the resulting PDF as a downloadable URL (true) or as binary data (false).
Title Title of the PDF document (used only when editing metadata).
Author Author of the PDF document (used only when editing metadata).
Subject Subject of the PDF document (used only when editing metadata).
Keywords List of keywords for the PDF document (used only when editing metadata).
File Name Desired name for the output PDF file after editing metadata.

Output

The node outputs JSON data containing the result of the metadata operation:

  • For Get Metadata: The output JSON includes the extracted metadata fields such as title, author, subject, and keywords.
  • For Edit Metadata: The output JSON contains the updated PDF either as a binary buffer or a downloadable URL depending on the "Return as URL" property.
  • If returning as a URL, the output will include a link to download the modified PDF.
  • If returning as binary, the output will contain the PDF file data suitable for further processing or saving.

Dependencies

  • Requires an API key credential for authentication with the external 0CodeKit service.
  • The node sends requests to the 0CodeKit API endpoint https://prod.0codekit.com/pdf/metadata/{operation}, where {operation} is either "edit" or "info".
  • No additional local dependencies are required; all processing is handled by the external API.

Troubleshooting

  • Common issues:
    • Providing an invalid or inaccessible PDF URL may cause errors or empty metadata results.
    • Supplying malformed or incomplete binary buffer data can lead to request failures.
    • Omitting required fields when editing metadata (e.g., missing file name when expecting output) might cause unexpected behavior.
  • Error messages:
    • Authentication errors if the API key credential is missing or invalid.
    • HTTP errors if the PDF URL is unreachable or the API service is down.
    • Validation errors if input parameters do not meet expected formats.
  • Resolutions:
    • Verify the PDF URL is publicly accessible and correct.
    • Ensure the binary buffer is properly encoded and complete.
    • Confirm that the API key credential is configured correctly in n8n.
    • Check that all required properties for the chosen operation are set.

Links and References

Discussion