Restructure PDF pages
manipulate_pdfMerge, split, rotate, extract pages, reverse order, or overlay PDFs to restructure their pages and write a new PDF.
Instructions
Restructure the pages of existing PDF file(s) and write a new PDF.
Each operation writes to output_path (overwriting any existing file) and returns JSON {status, operation}; on a missing required argument it returns {error, code}. Per-operation requirements: merge→input_paths; rotate→degrees; extract_pages→page_indices; overlay→overlay_path; split→output_path is a directory. Page indices are 0-based.
Use this for page-level structure. To stamp notes/highlights use annotate_pdf; to fill form fields use manage_forms; to encrypt use secure_pdf.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Page operation: 'split' one PDF into per-page files; 'merge' several PDFs into one; 'rotate' all pages; 'extract_pages' a subset; 'reverse' page order; 'overlay' one PDF on top of another. | |
| input_path | No | Source PDF. Required for every operation except 'merge' (which uses input_paths). | |
| input_paths | No | Ordered list of PDFs to combine. Required for 'merge'. | |
| output_path | No | Output location, overwritten if it exists. For 'split' this is an existing directory; for all other operations a .pdf file. | |
| degrees | No | Clockwise rotation in degrees (e.g. 90, 180, 270). Required for 'rotate'. | |
| page_indices | No | 0-based page indices to keep, in order. Required for 'extract_pages'. | |
| overlay_path | No | PDF stamped on top of input_path. Required for 'overlay'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |