Utilitly PDF
v0.1.1Merge, split, rotate, delete, reorder and duplicate PDF pages on your computer.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
pdf_info PDF info
Reads a PDF and reports its page count, file size, first page size in points, and whether it is password-protected. Changes nothing.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a PDF file, or one starting with ~/. |
merge_pdfs Merge PDFs
Combines PDFs into one, in the order given. The result is named after the first file, with -merged. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.
| Parameter | Type | Description |
|---|---|---|
paths * | array | Absolute paths of the PDFs to combine, in order |
output_path | string | Optional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input. |
split_pdf Split a PDF
Splits a PDF into one new file per comma-separated range, named -part1, -part2 and so on. "1-2, 3-end" gives two files, and one call writes at most 1,000 (or one per page for longer PDFs). Never replaces an existing file; the input is left unchanged.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path to a PDF file, or one starting with ~/. |
ranges * | string | Ranges such as "1-2, 3, 4-end": one output file per comma-separated part |
output_folder | string | Optional absolute path of an existing folder for the files. By default they go next to the input. |
extract_pages Extract pages
Copies the selected pages into one new PDF, in page order, named with -pages. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.
| Parameter | Type | Description |
|---|---|---|
pages * | string | Pages, such as "2", "1-3, 5" or "4-end". Commas separate parts. |
path * | string | Absolute path to a PDF file, or one starting with ~/. |
output_path | string | Optional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input. |
rotate_pdf Rotate pages
Turns pages clockwise by a multiple of 90 degrees (negative turns counter-clockwise), every page unless pages is given. Named with -rotated. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.
| Parameter | Type | Description |
|---|---|---|
angle * | integer | Degrees clockwise: 90, 180, 270, or -90 for counter-clockwise |
path * | string | Absolute path to a PDF file, or one starting with ~/. |
output_path | string | Optional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input. |
pages | string | Pages, such as "2", "1-3, 5" or "4-end". Commas separate parts. Every page when left out. |
delete_pages Delete pages
Removes the selected pages and keeps the rest in order, named with -trimmed. At least one page must remain. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.
| Parameter | Type | Description |
|---|---|---|
pages * | string | Pages to remove, such as "2", "1-3, 5" or "4-end". Commas separate parts. |
path * | string | Absolute path to a PDF file, or one starting with ~/. |
output_path | string | Optional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input. |
reorder_pages Reorder pages
Puts the pages in a new order, named with -reordered. The order must list every page exactly once; use pdf_info for the page count. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.
| Parameter | Type | Description |
|---|---|---|
order * | array | Every page number once, in the new order, e.g. [3, 1, 2] |
path * | string | Absolute path to a PDF file, or one starting with ~/. |
output_path | string | Optional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input. |
duplicate_pages Duplicate pages
Adds copies of the selected pages, right after each one or all at the end, named with -duplicated. Copies share the page's images, so the file barely grows. One call can add at most 10,000 pages. Writes the result as a new file next to the input (or to output_path) and never replaces an existing file; the input is left unchanged.
| Parameter | Type | Description |
|---|---|---|
pages * | string | Pages to copy, such as "2", "1-3, 5" or "4-end". Commas separate parts. |
path * | string | Absolute path to a PDF file, or one starting with ~/. |
copies | integer | Extra copies of each page. Default 1. |
output_path | string | Optional absolute path for the new PDF, ending in .pdf. It must not exist yet. By default the result goes next to the input. |
placement | string | "after" (default) puts copies right after each page; "end" adds them at the end. |