npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cafeasp/n8n-nodes-pdf-to-pdf

v0.1.0

Published

n8n node to re-save PDF files to fix missing page dimensions and other issues

Downloads

12

Readme

n8n PDF to PDF Node

An n8n community node that re-saves PDF files to fix missing page dimensions and other structural issues. This node processes PDF binary data and outputs a properly formatted PDF with corrected metadata.

Why This Node?

Some PDF files may have missing or incorrect page dimensions, which can cause issues when:

  • Displaying PDFs in viewers
  • Converting PDFs to other formats
  • Processing PDFs with other tools
  • Printing documents

This node loads the PDF, ensures all pages have proper dimensions, and saves it as a new properly formatted PDF file.

Installation

Follow the installation guide in the n8n community nodes documentation.

Manual Installation

  1. Install the package in your n8n installation:
npm install @cafeasp/n8n-nodes-pdf-to-pdf
  1. Restart n8n to load the new node.

Development Installation

  1. Clone this repository:
git clone https://github.com/cafeasp/n8n-pdf-to-pdf.git
cd n8n-pdf-to-pdf
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Link your node to n8n:

Linux/Mac:

npm link
cd ~/.n8n/custom
npm link @cafeasp/n8n-nodes-pdf-to-pdf

Windows (PowerShell - Run as Administrator):

npm link
cd $env:USERPROFILE\.n8n\custom
npm link @cafeasp/n8n-nodes-pdf-to-pdf

Windows (Command Prompt - Run as Administrator):

npm link
cd %USERPROFILE%\.n8n\custom
npm link @cafeasp/n8n-nodes-pdf-to-pdf
  1. Restart n8n to load the new node.

Usage

Node Configuration

The node has the following parameters:

  • Binary Property: The name of the binary property containing the input PDF file (default: "data")
  • Output Binary Property: The name of the binary property where the re-saved PDF will be stored (default: "data")
  • Options:
    • File Name: Optional custom file name for the output PDF

Example Workflow

  1. Read a PDF file using the "Read Binary File" node or receive it from an HTTP request
  2. Add the "PDF to PDF" node
  3. Configure the binary property names (or use defaults)
  4. The node will output the re-saved PDF with proper page dimensions
  5. Use the output with other nodes (save to file, send via email, upload to cloud storage, etc.)

What the Node Does

  1. Accepts a PDF file as binary input
  2. Loads the PDF using pdf-lib
  3. Processes each page to ensure dimensions are properly set
  4. Saves the PDF with corrected metadata
  5. Returns the new PDF as binary output

Development

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • n8n installed (for testing)

Scripts

  • npm run build - Build the project and copy icons
  • npm run dev - Watch mode for development
  • npm run format - Format code with Prettier
  • npm run lint - Lint the code
  • npm run lintfix - Auto-fix linting issues

Technical Details

This node uses the pdf-lib library to:

  • Load PDF documents
  • Access and process page dimensions
  • Save modified PDFs with proper structure

Compatibility

  • n8n version: 0.198.0 or higher
  • n8n nodes API version: 1

License

MIT

Author

Victor Pacheco

Support

If you encounter any issues or have questions:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Start or restart(control c) n8n:
npm run build
npx n8n

Your node should now appear in the nodes panel

Customization

  1. Update package.json: Change the name, description, author, and repository fields
  2. Rename files: Rename Example.node.ts and the credential file to match your integration
  3. Update the node: Modify the node properties, operations, and logic in the .node.ts file
  4. Update credentials: Adjust the credential properties to match your API requirements
  5. Replace icon: Replace example.svg with your own icon
  6. Update n8n config: Update the n8n section in package.json to reflect your renamed files

Publishing

Before publishing to npm:

  1. Update package.json with your package details
  2. Ensure your package name starts with n8n-nodes-
  3. Add n8n-community-node-package to keywords in package.json
  4. Build the project: npm run build
  5. Publish: npm publish

Resources

License

MIT