TruePath PDF
v0.3.0Local-only PDF tools for AI — extract text, search, split/merge, render pages.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_info Get PDF info
Return page count, first-page size, encryption status, and embedded metadata (title, author, dates, producer, etc.) for a local PDF.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a PDF on the local filesystem. |
extract_text Extract text
Extract plain text from a local PDF. Optionally restrict to a page range like "1-5" or "1,3,5-7". Output is split by page with === Page N === markers.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a PDF on the local filesystem. |
pages | string | Page range (1-based). Examples: "3", "1-5", "1,3,5-7". Omit for all pages. |
search Search PDF
Find a substring across the whole PDF. Returns each hit's page, offset within the page, and a snippet of surrounding text. Use for grep-style discovery before extracting full text.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a PDF on the local filesystem. |
query * | string | Text to search for. |
caseSensitive | boolean | Case-sensitive match. Default false. |
contextChars | integer | How many characters of surrounding text to include per hit (default 60). |
maxHits | integer | Cap the number of hits returned (default 200). |
split Split PDF
Split a PDF into multiple PDFs by page ranges. Each range becomes one output file written into outputDir.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to the source PDF. |
ranges * | array | Page ranges to split into separate output PDFs, 1-based. Examples: ["1-3", "4-7", "8"] produces three files. Each range becomes one output PDF. |
basename | string | Stem for output filenames. Default = source filename without .pdf. Final names look like '<basename>-1-3.pdf'. |
outputDir | string | Directory to write outputs into. Defaults to the source PDF's directory. |
merge Merge PDFs
Combine two or more PDFs into one, preserving page order. Outputs to a caller-specified path.
| Parameter | Type | Description |
|---|---|---|
outputPath * | string | Absolute path for the combined output PDF. Its parent directory will be created if missing. |
paths * | array | Two or more absolute PDF paths to combine, in order. The result preserves pages in the order given. |
pages Edit pages (rotate / delete / reorder)
One-pass page editor. Delete pages, rotate specific pages by 90°/180°/270°, and reorder the result — in any combination. Page numbers in `rotate` refer to the SOURCE PDF; `reorder` refers to post-delete positions.
| Parameter | Type | Description |
|---|---|---|
outputPath * | string | Absolute path to write the result to. |
path * | string | Absolute path to the source PDF. |
delete | string | Pages to delete, 1-based, comma/range form. Example: "1,3,5-7". Applied BEFORE rotate and reorder. |
reorder | array | New page order, expressed as 1-based positions in the post-delete output. Example: [3,1,2] puts page 3 first. Must be a permutation of all surviving pages. |
rotate | array | Per-page absolute rotations applied to pages that survive the delete step. Page numbers refer to the SOURCE PDF, not the post-delete one — easier to reason about. |
to_images Render pages to images
Rasterize PDF pages as PNG or JPG at a chosen DPI. Useful for previews, OCR pipelines, or feeding pages back to a vision model.
| Parameter | Type | Description |
|---|---|---|
outputDir * | string | Directory to write the rendered images into. |
path * | string | Absolute path to the source PDF. |
basename | string | Stem for output filenames. Default = source filename without .pdf. Final names: '<basename>-001.png' (page number padded to 3 digits). |
dpi | integer | Render resolution. Default 150. PDF native is 72; common values: 96 screen, 150 print preview, 300 print. |
format | string | Output format. Default "png". "jpg" is smaller but lossy. |
jpgQuality | integer | JPEG quality 40-100. Default 85. Ignored for PNG. |
pages | string | 1-based page range, e.g. "3", "1-5", "1,3,5-7". Omit for all pages. |
extract_images Extract embedded images
Pull embedded images out of a PDF and write each as a PNG. Unsupported pixel layouts (e.g. CMYK, palettized) are skipped and reported.
| Parameter | Type | Description |
|---|---|---|
outputDir * | string | Directory to write extracted images into. |
path * | string | Absolute path to the source PDF. |
basename | string | Stem for output filenames. Default = source name. Final form: '<stem>-p001-img01.png'. |
pages | string | 1-based page range. Omit for all pages. Format: "1-5" or "1,3,5-7". |
open_in_truepath Open in TruePath PDF (Mac app)
Hand a local PDF to the TruePath PDF Mac app via its truepath:// URL scheme so the user can finish work in a GUI (annotate, sign, fill forms, redact). The bridge is fire-and-forget — the app handles opening from there. Requires the app installed (https://joytruepath.com/truepath-pdf).
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to the PDF to open in the TruePath PDF Mac app. |
scheme | string | URL scheme of the receiving app. Default "truepath". Set this if you're handing off to a re-branded build of the engine — e.g. "yochenpdf" for the Yochen core build, or whatever urlScheme the destin… |