Trim the back matter before it eats your context window.
Clean the paper. Keep the argument. Save the context window.
v0.1.0First public release with Zotero 7/8 support, split/export workflow, sidebar actions, and one-click cleanup for generated PDFs.
Most papers are much longer than the part we actually want to hand to an LLM.
When we send a paper to an LLM, we usually want the core argument, method, experiment design, and takeaways. But the PDF often also contains long References, appendices, prompts, pseudocode, ablations, and implementation details. Those sections are valuable for close reading, but they can also eat a surprising amount of context window.
That creates a familiar workflow tax:
- more tokens spent on material you may not need right now
- more noise in summaries and extraction tasks
- less room left for the actual paper
PDFTrim for LLM was built for that exact moment inside Zotero: you are reading a paper, you want a clean PDF for an LLM, and you do not want to manually export, crop, rename, and re-attach files every time.
This need was strongly inspired by llm-for-zotero and Vibero, which made the LLM-in-Zotero workflow feel very real and very useful. PDFTrim for LLM focuses on one small but painful bottleneck in that workflow: trimming token-heavy back matter before the paper goes into the model.
This project is built on top of zotero-plugin-template.
- Detects where
Referencesstarts. - Infers where
Appendixbegins. - Lets you review and edit the detected page numbers.
- Exports LLM-friendly PDFs next to the original file.
- Keeps the original PDF untouched.
- Attaches generated PDFs back to the same Zotero item.
- Lets you open or delete generated outputs from the sidebar.
The detected split positions are heuristic and are not always exact.
Before exporting, you should always:
- review the detected
References start page - review the detected
Appendix start page - use
Jumpto verify the pages manually - adjust the page numbers if needed
The plugin is designed to reduce repetitive work, not to replace human confirmation.
| Automatically detects the References and Appendices sections in a PDF. | Click Jump to navigate directly to the detected page. If the result is not accurate enough, you can also adjust it manually. |
|---|---|
![]() |
![]() |
- Download the latest
.xpifrom GitHub Releases. - Open Zotero.
- Go to
Tools -> Plugins. - Drag the
.xpifile into the Plugins window. - Restart Zotero if needed.
The release asset is expected to look like:
pdf-trim-for-llm.xpi
- Open a PDF in the Zotero reader.
- Open
PDFTrim for LLMin the right sidebar. - Wait for automatic detection.
- Review:
References start pageAppendix start page
- Use
Jumpto confirm the detected pages. - Adjust the page numbers if needed.
- Choose a mode:
Extract Main TextSplit into Sections
- Click
Split PDF.
Generated PDFs are saved next to the source PDF and attached to the same Zotero item.
Given:
paper.pdf
Extract Main Text creates:
paper-main.pdf
Split into Sections creates:
paper-main.pdf
paper-reference.pdf
paper-appendix.pdf
The source PDF is never modified.
Requirements:
- Node.js LTS
- Git
- Zotero 7 or Zotero 8
Start development:
npm install
npm startProduction build:
npm run buildBuild outputs are generated in:
.scaffold/build/
This repository is already configured for:
- GitHub Releases
update.json/update-beta.json- Zotero
.xpipackaging
This project is released under AGPL-3.0-or-later.



