StayPut

v0.1.0
io.github.keenanlk/stayput Checked 3 days ago Published 2 months ago

Local PDF and photo tools: merge, split, rotate, number PDFs; strip photo GPS.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

pdf_info PDF info

Read a PDF on this machine and report its page count, page sizes, title and whether it was encrypted. Use before splitting, extracting or rotating to learn how many pages there are.

ParameterTypeDescription
path *stringPath to the PDF.
passwordstringPassword for a PDF that asks for one when opened. Used only on this machine.

merge_pdfs Merge PDFs

Combine several PDFs on this machine into one, in the order given. The same file may appear more than once. Writes a new PDF and returns its path.

ParameterTypeDescription
inputs *arrayPDF paths, in the order their pages should appear.
outputstringWhere to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead.
passwordstringPassword for a PDF that asks for one when opened. Used only on this machine.

extract_pdf_pages Extract, reorder or delete PDF pages

Write a new PDF containing only the listed pages, in the listed order. Use it to pull out a range, reorder pages ("3,1,2") or drop pages (list the ones to keep). Pages are 1-based; ranges like "1-3, 7" and reversed ranges like "5-1" work.

ParameterTypeDescription
input *stringPath to the PDF.
pages *stringPages to keep, for example "1-3, 7" or "3,1,2".
outputstringWhere to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead.
passwordstringPassword for a PDF that asks for one when opened. Used only on this machine.

split_pdf Split PDF

Split a PDF into several files of N pages each (1 = one file per page), written into a folder. Returns the list of files.

ParameterTypeDescription
input *stringPath to the PDF.
output_dirstringFolder for the parts. Defaults to a new folder beside the input named <file>-split.
pages_per_fileintegerPages in each output file. Default 1.
passwordstringPassword for a PDF that asks for one when opened. Used only on this machine.

rotate_pdf Rotate PDF pages

Rotate all pages, or only the listed ones, clockwise by 90, 180 or 270 degrees, and save the rotation permanently in a new PDF.

ParameterTypeDescription
degrees *Clockwise rotation to add.
input *stringPath to the PDF.
outputstringWhere to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead.
pagesstringPages to rotate, for example "1, 3-4". Default: every page.
passwordstringPassword for a PDF that asks for one when opened. Used only on this machine.

number_pdf_pages Add page numbers

Stamp page numbers on a PDF. The template may use {n} for the page number and {total} for the last number, e.g. "Page {n} of {total}".

ParameterTypeDescription
input *stringPath to the PDF.
first_pageintegerFirst page (1-based) that gets a number; earlier pages, such as a cover, are left blank.
font_sizenumber
outputstringWhere to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead.
passwordstringPassword for a PDF that asks for one when opened. Used only on this machine.
positionstring
startintegerNumber printed on the first numbered page.
templatestringText to print. Default "{n}".

images_to_pdf Images to PDF

Put JPG and PNG images into one PDF, one image per page, in the order given. Images are embedded as they are, without re-compression.

ParameterTypeDescription
inputs *arrayJPG or PNG paths, in page order.
marginnumberMargin in points (72 = 1 inch).
outputstringWhere to write the result. Defaults to a new file beside the input. Existing files are never overwritten; a free name like file-1.pdf is used instead.
page_sizestring"fit" makes each page the size of its image; "a4" and "letter" centre the image on a standard page.

inspect_image_metadata Inspect photo metadata

Report the metadata hidden in a JPG, PNG or WebP photo: GPS location, camera make and model, capture time, editing software, and which blocks (EXIF, XMP, IPTC, comments) are present. HEIC files report EXIF only.

ParameterTypeDescription
path *stringPath to the image.

strip_image_metadata Remove photo metadata

Write a copy of a JPG, PNG or WebP photo with EXIF (including GPS location), XMP, IPTC and comments removed. Lossless: the image data is not re-encoded. The original file is left untouched.

ParameterTypeDescription
input *stringPath to the image.
keep_color_profilebooleanKeep the ICC colour profile so colours look the same. Default true.
outputstringWhere to write the cleaned copy. Defaults to <name>-clean.<ext> beside the input. Existing files are never overwritten.