pdflib-wrapper

A collection of nodes for the PDFLib library

Package Information

Downloads: 1 weekly / 5 monthly
Latest Version: 0.1.1
Author: Ofir

Documentation

Banner image

n8n-nodes-starter

This repo contains example nodes to help you get started building your own custom integrations for n8n. It includes the node linter and other dependencies.

To make your custom node available to the community, you must create it as an npm package, and submit it to the npm registry.

Prerequisites

You need the following installed on your development machine:

  • git
  • Node.js and pnpm. Minimum version Node 18. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL here. For Windows users, refer to Microsoft's guide to Install NodeJS on Windows.
  • Install n8n with:
    pnpm install n8n -g
    
  • Recommended: follow n8n's guide to set up your development environment.

Using this starter

These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the documentation.

  1. Generate a new repository from this template repository.
  2. Clone your new repo:
    git clone https://github.com/<your organization>/<your-repo-name>.git
    
  3. Run pnpm i to install dependencies.
  4. Open the project in your editor.
  5. Browse the examples in /nodes and /credentials. Modify the examples, or replace them with your own nodes.
  6. Update the package.json to match your details.
  7. Run pnpm lint to check for errors or pnpm lintfix to automatically fix errors when possible.
  8. Test your node locally. Refer to Run your node locally for guidance.
  9. Replace this README with documentation for your node. Use the README_TEMPLATE to get started.
  10. Update the LICENSE file to use your details.
  11. Publish your package to npm.

More information

Refer to our documentation on creating nodes for detailed information on building your own nodes.

License

MIT

n8n-nodes-pdflib-wrapper

This is an n8n community node that wraps the functionality of the pdf-lib library, allowing you to extract form field information from PDF files within your n8n workflows.

Installation

Using n8n CLI

# Install the node package
npm install n8n-nodes-pdflib-wrapper@latest

# Also install the required pdf-lib dependency
npm install pdf-lib@latest

Adding to your n8n instance

  1. Go to Settings > Community Nodes
  2. Click on Install
  3. Enter n8n-nodes-pdflib-wrapper in the "npm package name" field
  4. Click on Install
  5. After installation, restart your n8n instance

Node Features

Get Form Fields

Extracts form field information from a PDF file, including:

  • Field names
  • Field types (text, checkbox, radio button, dropdown, etc.)
  • Current values
  • Options for choice fields
  • Required status

Usage

Input

The node accepts binary data containing a PDF file. You can connect any node that outputs binary data, such as:

  • HTTP Request
  • Read Binary File
  • Webhook (with file upload)

Configuration

  1. Input Binary Field: Specify the name of the binary property containing the PDF file. If left empty, the node will automatically use the first available binary property.
  2. Options:
    • Include Field Metadata: Enable to include additional metadata about each field, such as read-only status, exact field type, and appearance information

Output

The node outputs a JSON object containing:

  • pdfFields: An array of form field objects
  • source: Information about the binary property used

Each field object includes:

  • name: The name of the form field
  • type: The type of form field (text, checkbox, radio, dropdown, etc.)
  • value: The current value of the field
  • options: Available options for dropdown fields
  • When Include Field Metadata is enabled:
    • metadata.isReadOnly: Whether the field is read-only
    • metadata.fieldType: The exact PDF field type
    • metadata.hasAppearance: Whether the field has visual appearance settings

Example Workflows

Extract PDF Form Fields

  1. Use the Read Binary File node to read a PDF form
  2. Connect it to the PDF-lib Wrapper node
  3. Configure the PDF-lib Wrapper to use the binary data property
  4. The output will contain all form field information

License

MIT

Discussion