Extract pages into one PDF
extract_pagesExtract selected pages from a source PDF into a new PDF with just those pages, in the order you specify. Trim large documents down to the essential pages you need.
Instructions
Keep an arbitrary pages[] subset (0-based, in the given order) in ONE fresh PDF. Same page-tree caveats as merge_pdfs (signatures/AcroForm/XMP dropped; boxes kept; URI links unless dropAnnotations). Encrypted sources: password; output unencrypted unless encrypt. Need several documents? Use split_pdf.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | Yes | 0-based page indices to keep, in output order. Duplicates and out-of-range indices are rejected. | |
| encrypt | No | Re-encrypt the output (Standard Security Handler; AES-128 default or AES-256; RC4 never emitted). | |
| password | No | Password (user or owner) of an encrypted source. Never logged or echoed. | |
| pdfBase64 | Yes | Base64-encoded source PDF. Pass `password` for an encrypted source. | |
| outputMode | No | 'base64' (default) returns the PDF inline; 'file' writes it inside the PDFNATIVE_MCP_OUTPUT_DIR sandbox (SECURITY_VIOLATION when the sandbox is not configured). | base64 |
| outputPath | No | Required when outputMode='file'. Relative path inside the sandbox; must end with .pdf (no absolute paths, no '..'). | |
| dropAnnotations | No | When true, drop ALL annotations. Default keeps self-contained URI link annotations. | |
| maxOutputSizeBytes | No | Maximum size, in bytes, of the produced PDF. Defaults to 268435456 (256 MiB). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| summary | No | Tool-specific summary, when produced. | |
| filePath | No | Sandboxed absolute path (file mode). | |
| sizeBytes | Yes | ||
| diagnostics | No | PDF/A diagnostics (when includeDiagnostics=true). |