Skip to content
Back to skills

Sandbox Pdf

ASecurity

Extract the embedded text of a PDF, whole or per page, in a Code node or CodeAct action, with pdf-parse running on the host. It reads text the PDF already carries; it does not OCR a scanned page.

  • 552 stars
  • 0 votes
  • 0 copies
  • 2 views
  • 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-pdf --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sandbox Pdf?

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

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

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-pdf
description: Extract the embedded text of a PDF, whole or per page, in a Code node or CodeAct action, with pdf-parse running on the host. It reads text the PDF already carries; it does not OCR a scanned page.
---

# PDF text in the sandbox

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

pdf-parse drives pdf.js, which needs Node builtins and a canvas; it is not a
guest-module candidate. This pack is a **host module**: the import resolves to a
generated facade over NodeTool's own implementation.

## extractText — whole document to plain text

```js
import { extractText } from "@nodetool-ai/sandbox-pdf";

const bytes = await workspace.readBytes("report.pdf");
const text = await extractText(bytes);
```

All pages concatenated, in order, with no page markers.

## extractPages — one item per page

```js
import { extractPages } from "@nodetool-ai/sandbox-pdf";

const pages = await extractPages(bytes);
// [{ index: 0, pageNumber: 1, text: "Quarterly report" }, ...]
```

Get the bytes from `workspace.readBytes`, or from a fetched body with
`await response.bytes()`.

## Gotchas

- **Both exports are async.**
- **10 MB per document.** Larger input is refused by name.
- **No OCR.** Both exports read the text layer the PDF already carries. A
  scanned page is an image and comes back empty — run
  `@nodetool-ai/sandbox-ocr` over the page image, or a vision model, for that.
- **Text only.** Neither export reads images, tables as tables, or form fields.
  Layout is approximated from text positions, so column order in a
  multi-column page is not guaranteed.
- **An encrypted or malformed PDF throws** with the reason pdf.js gives.

Files in this skill

  • SKILL.md1.7 KB
  • package.json845 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.