Nano PDF
When to Use
Use when the user asks to edit a PDF and the local nano-pdf CLI is available.
Good fits:
- change text on a specific page
- add a watermark
- remove or redact a small visible element
- apply a narrow natural-language edit to a page
Do not use when the task requires full document re-layout, legal-grade redaction guarantees, OCR-heavy reconstruction, form extraction, or arbitrary PDF generation.
Preflight
Before editing:
command -v nano-pdf
nano-pdf --help
If the CLI is unavailable, do not claim the edit was completed. Return a fallback plan or ask whether the user wants to install/configure the tool.
Workflow
- Confirm the source PDF path and requested output behavior.
- Create a backup or work on a copy. Never overwrite the only source PDF.
- Confirm the intended page number with the user-facing page label if possible.
- Run a small test or inspect output when page indexing may be ambiguous. Some versions/configurations may treat page numbers as 0-based while users expect 1-based.
- Run the edit.
- Open, render, or visually inspect the affected pages before delivery.
- If the edit landed on the wrong page, restore from backup and retry with the corrected index.
Command Pattern
nano-pdf edit <input.pdf> <page> "<natural language instruction>"
Example:
nano-pdf edit deck.pdf 3 "Change the title to Q3 Results and add a Confidential watermark"
Prefer working-copy names such as:
source.pdf
source.working.pdf
source.edited.pdf
Return Format
Return:
- output PDF path
- backup path
- affected pages
- command summary
- visual verification status
- known risks or manual checks
If the CLI is missing or the edit cannot be verified, return:
ok: false- reason
- suggested fallback
- any prepared but unexecuted instruction
Limits and Known Issues
- Page numbering may be 0-based or 1-based depending on the installed CLI version/configuration. Verify before final delivery.
- Natural-language edits may not preserve exact typography or layout.
- PDF redaction is high risk. For sensitive redaction, require visual verification and consider a specialized redaction workflow.
- Scanned PDFs may require OCR and may not be editable as text.
- Always inspect output pages; a successful CLI exit is not enough.