Skip to content
Back to skills

Sandbox Pdflib

ASecurity

Build and merge PDF files in a Code node or CodeAct action, with pdf-lib running on the host

  • 552 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 1, 2026
ai-agentsgonode

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 1, 2026

npx -y skills add nodetool-ai/nodetool --skill sandbox-pdflib --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sandbox Pdflib?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sandbox Pdflib
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nodetool-ai-sandbox-pdflib/badge)](https://www.skillsdirectory.com/skills/nodetool-ai-sandbox-pdflib)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sandbox-pdflib
description: Build and merge PDF files in a Code node or CodeAct action, with pdf-lib running on the host
---

# PDF writing in the sandbox

Specifier: `@nodetool-ai/sandbox-pdflib`. Import it at the top of the body.

This pack **writes** PDFs. To extract text from an existing file, use
`@nodetool-ai/sandbox-pdf` instead.

## build — pages to PDF bytes

Coordinates are **top-left**, in PDF points (72 per inch). A US Letter page
is 612×792.

```js
import { build } from "@nodetool-ai/sandbox-pdflib";

const bytes = await build({
  pages: [
    {
      width: 612,
      height: 792,
      items: [
        { type: "text", x: 72, y: 72, text: "Hello", size: 24, color: "#111827" },
        { type: "image", x: 72, y: 120, width: 200, height: 120, data: inputs.logo }
      ]
    }
  ]
});
await workspace.writeBytes("hello.pdf", bytes);
```

Item types:

- `text` — `x`, `y`, `text`, `size` (points, default 12), `color` (hex)
- `image` — `x`, `y`, `width`, `height`, `data` (`Uint8Array` PNG or JPEG)

## merge — concatenate PDFs

```js
import { merge } from "@nodetool-ai/sandbox-pdflib";

const bytes = await merge([inputs.first, inputs.second]);
await workspace.writeBytes("combined.pdf", bytes);
```

Each entry is a `Uint8Array` of an existing PDF.

## Gotchas

- **Host module.** `build` and `merge` are async and return a `Uint8Array`.
- **At most 200 pages** (or 200 source documents for `merge`).
- **Images are PNG or JPEG bytes**, sniffed from the magic header.

Files in this skill

  • SKILL.md1.5 KB
  • package.json827 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.