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

n8n-nodes-pdf-writer

v1.1.3

Published

n8n node to write text or images at X/Y coordinates on PDF pages and merge multiple PDFs with page selection

Readme

n8n-nodes-pdf-writer

A custom n8n community node with three operations:

  • Write Text – write text at specific X/Y coordinates on any PDF page
  • Add Images – add images (PNG/JPG) at specific coordinates on any PDF page
  • Merge PDFs – merge specific pages from multiple PDF files into one

This node was designed to fill a necessary gap, and we've decided to make it available for anyone who needs this functionality in n8n.


Features

  • ✅ Write text at precise X/Y coordinates on any page
  • ✅ Add images (PNG/JPG) at precise X/Y coordinates
  • ✅ Label each text entry for easy identification
  • ✅ Multiple text entries per execution
  • ✅ Target a specific page or all pages at once
  • ✅ Y-origin toggle: measure from top or bottom of the page
  • ✅ Choose from 7 built-in fonts (Helvetica, Times, Courier families)
  • ✅ Set font size, color (hex), rotation, and opacity
  • ✅ Merge multiple PDFs into one — all pages or select specific pages per file
  • ✅ Page selection supports ranges and lists (e.g. 1,3,5-8)
  • ✅ Works with binary PDF data from any n8n node

Installation

In the n8n UI: Settings → Community Nodes → Install → enter n8n-nodes-pdf-writer

Then restart n8n.


Operations

Write Text

Writes one or more text entries at specified X/Y positions on a PDF.

| Parameter | Description | |---|---| | Input PDF Field | Binary field name holding the source PDF (default: data) | | Output Field Name | Binary field name to write the result to (default: data) |

Text Entry fields

| Field | Description | |---|---| | Label | A name to identify this entry (e.g. "Header", "Footer", "Stamp") | | Text | The text string to draw | | Page | Page number (1-based). Set to 0 to apply to all pages | | X Position | Points from the left edge | | Y Position | Points from the selected Y origin | | Y Origin | From Bottom (PDF default) or From Top (more intuitive) | | Font Size | Size in points | | Font | Helvetica, Helvetica Bold, Times Roman, Courier, etc. | | Color (Hex) | Text color, e.g. #FF0000 for red | | Rotation | Degrees counter-clockwise | | Opacity | 0.0 (invisible) → 1.0 (solid) |


Add Images

Adds one or more images (PNG or JPG) at specified X/Y positions on a PDF.

| Parameter | Description | |---|---| | Input PDF Field | Binary field name holding the source PDF (default: data) | | Output Field Name | Binary field name to write the result to (default: data) |

Image Entry fields

| Field | Description | |---|---| | Image Binary Field | Binary field name holding the image (PNG or JPG) | | Page | Page number (1-based). Set to 0 to apply to all pages | | X Position | Points from the left edge | | Y Position | Points from the selected Y origin | | Y Origin | From Bottom (PDF default) or From Top | | Width / Height | Dimensions in points. If one is set, the other scales proportionally. If both 0, uses original size. | | Rotation | Degrees clockwise | | Opacity | 0.0 (invisible) → 1.0 (solid) |


Merge PDFs

Takes all input items (each carrying a PDF binary) and merges them into a single PDF. You can include all pages or select specific pages from each file.

| Parameter | Description | |---|---| | Binary Field | Binary field name that holds the PDF in each input item (default: data) | | Pages Per Item | All Pages or Select Pages Per Item | | Pages | Page selection per item — supports all, single pages (1,3,5), and ranges (2-4). Pages are 1-based. Supports n8n expressions. | | Output Field Name | Binary field name for the merged PDF output (default: data) | | Output File Name | File name of the merged PDF (default: merged.pdf) |

Page selection format

| Input | Meaning | |---|---| | all | All pages from this PDF | | 1,3,5 | Pages 1, 3 and 5 only | | 2-6 | Pages 2 through 6 | | 1,3,5-8 | Pages 1, 3 and 5 through 8 |

You can use n8n expressions in the Pages field to select different pages from each item dynamically:

{{ $itemIndex === 0 ? "1-3" : $itemIndex === 1 ? "2,5" : "all" }}

Coordinate System (Write Text)

PDF coordinates by default start at the bottom-left corner (0, 0). A standard A4 page is 595 × 842 points.

(0, 842) ─────────────── (595, 842)   ← Top
   │                          │
   │     Y increases ↑        │
   │                          │
(0, 0) ──────────────── (595, 0)      ← Bottom (PDF origin)

When Y Origin = "From Top" is selected, the node automatically converts for you:
y_pdf = page_height − y_from_top

Tip: A4 = 595 × 842 pt | Letter = 612 × 792 pt | 1 inch = 72 points


Example Workflows

Write Text

[Read Binary File] → [PDF Text Writer (Write Text)] → [Write Binary File]
  1. Use Read Binary File (or HTTP Request, etc.) to get a PDF into a binary field
  2. Add a PDF Text Writer node, set Operation to Write Text
  3. Add text entries with label, content, position and style
  4. The output binary field contains the modified PDF

Sample text entry configuration

{
  "label": "Confidential Stamp",
  "text": "CONFIDENTIAL",
  "page": 1,
  "x": 200,
  "y": 50,
  "yOrigin": "top",
  "fontSize": 24,
  "font": "Helvetica-Bold",
  "color": "#FF0000",
  "rotation": 0,
  "opacity": 0.8
}

Merge PDFs

[Item 1: PDF A] ─┐
[Item 2: PDF B] ─┼─→ [PDF Text Writer (Merge PDFs)] → [Write Binary File]
[Item 3: PDF C] ─┘
  1. Feed multiple items, each with a PDF binary field
  2. Add a PDF Text Writer node, set Operation to Merge PDFs
  3. Set Pages Per Item to Select Pages Per Item and configure a Pages expression
  4. The single output item contains the merged PDF

Dependencies

  • pdf-lib – Pure JavaScript PDF manipulation

License

MIT