@tagur/pdfv2026.07.16.1
01README
PDF extraction model for swamp.
Reads local PDF files and extracts their content as structured markdown with best-effort detection of headings, tables, lists, and paragraphs. Also captures PDF metadata (title, author, page count, creation/modification dates).
Methods: extract (single file), extract_batch (all PDFs in a directory — factory pattern producing one resource per file).
Quick Start
swamp extension pull @tagur/pdf
swamp model create @tagur/pdf my-pdf
swamp model method run my-pdf extract --input filePath=/path/to/document.pdf
swamp model method run my-pdf extract_batch --input dirPath=/path/to/pdfs
swamp data query 'modelName == "my-pdf"' --select '{"name": name, "pages": attributes.metadata.pageCount}'02Models
@tagur/pdfv2026.07.16.1pdf.ts
fn extract(filePath: string)
Extract text content from a single local PDF file as structured markdown
| Argument | Type | Description |
|---|---|---|
| filePath | string | Absolute path to the PDF file to extract |
fn extract_batch(dirPath?: string, filePaths?: array, recursive: boolean, pattern?: string)
Extract multiple PDFs — pass a directory, a list of file paths, or both. One document resource per file (factory pattern)
| Argument | Type | Description |
|---|---|---|
| dirPath? | string | Absolute path to a directory containing PDF files |
| filePaths? | array | Explicit list of absolute paths to PDF files |
| recursive | boolean | Recurse into subdirectories (only applies to dirPath) |
| pattern? | string | Optional regex to filter file names (applied to base name, not full path; only applies to dirPath) |
Resources
document(infinite)— Extracted PDF content as structured markdown with metadata
03Stats
A
100 / 100
Downloads
0
Archive size
703.2 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
04Platforms
05Labels