A Zotero plugin that automatically matches and attaches local PDFs to items in your library based on DOI matching.
- Automatic PDF Matching: Matches PDFs in a local folder hierarchy to Zotero items using DOI identifiers
- Efficient Caching: Builds and caches a DOI-to-file map for fast subsequent matches
- Configurable Root Path: Set any folder as the root for PDF scanning
- Adjustable Scan Depth: Control how deep the plugin scans subdirectories
- History Tracking: View recent matching operations with summary statistics
- Diagnostics: Quick diagnostic tool to verify plugin configuration
- Batch Attachment: Attach multiple PDFs in one operation
- Download the latest
.xpifile from Releases - In Zotero, go to Tools → Add-ons
- Click the gear icon and select Install Add-on from File...
- Select the downloaded
.xpifile
- Clone this repository:
git clone https://github.com/fdossi/Attach-Finder.git
- In Zotero, create a proxy entry for development:
- Open your Zotero profile folder
- Navigate to
extensionsdirectory - Create a file named
[email protected](no extension) - Add the full path to the repository folder (one line, no trailing newline)
- Open Zotero and select one or more items with DOI fields
- Go to Tools → Attach Finder → Definir pasta raiz de PDFs
- Select the root folder containing your PDF files
- The plugin will scan subdirectories to build a cache
- Select one or more Zotero items with DOI values
- Go to Tools → Attach Finder → Anexar PDFs por DOI
- The plugin scans for matching PDFs and attaches them to items
- A summary dialog shows results (attached, not found, failed)
- Reindex Cache: Rebuild the PDF-to-DOI mapping (use after adding/moving files)
- Clear Cache: Remove the cached mapping (useful if performance degrades)
- Recent History: View last 10 matching operations
- Diagnostic: Quick check of plugin configuration and cache state
The plugin stores preferences in Zotero's settings:
extensions.attachFinder.rootPath: Path to your PDF root folderextensions.attachFinder.scanMaxDepth: Maximum directory depth to scan (default: 5)extensions.attachFinder.confirmBeforeFullScan: Ask before scanning many directories
The plugin identifies DOIs in PDF file names and metadata using this pattern:
10.\d{4,9}/[\-._;()/:A-Z0-9]+
For example:
10.1234/example.pdf→ DOI:10.1234/exampleSmith2023_10.1234/test.pdf→ DOI:10.1234/test
- Collects all DOIs from selected Zotero items
- Checks cache first for known file paths
- For uncached DOIs, scans the PDF root folder
- Extracts DOIs from PDF file names and metadata headers
- Attaches found matches to corresponding items
- Caching prevents repeated file system scans
- Respects user-configured scan depth limits
- Batch operations improve efficiency over individual attachments
- Ensure your Zotero version is 7.0 or later
- Check the plugin's version compatibility in manifest.json
- Verify DOIs are present in Zotero item records (not just file names)
- Use Diagnostic to confirm root path is set correctly
- Run Reindex Cache to rebuild the mapping
- Check that PDF files are readable and not in hidden folders
- Reduce
scanMaxDepthto avoid deep directory traversals - Clear cache if it grows too large
- Consider organizing PDFs in a shallower structure
bootstrap.js - Main plugin logic and lifecycle hooks
manifest.json - Plugin metadata and compatibility info
icon.svg - Plugin icon
Create a .xpi file:
# Windows PowerShell
Compress-Archive -Path manifest.json,bootstrap.js,icon.svg -DestinationPath Attach-Finder-1.1.3.zip -CompressionLevel Optimal
Rename-Item Attach-Finder-1.1.3.zip Attach-Finder-1.1.3.xpi
# Linux/macOS
zip -r Attach-Finder-1.1.3.xpi manifest.json bootstrap.js icon.svg- Minimum: Zotero 7.0
- Tested up to: Zotero 9.0.5.*
MIT License - see LICENSE file for details
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Submit a pull request with clear description of changes
Found a bug or have a feature request? Please open an issue on GitHub Issues.
- Renamed plugin branding to Attach Finder
- Updated IDs, links, and citation metadata for Attach-Finder repository
- Added refreshed plugin icon
- Initial release
- Automatic PDF matching by DOI
- Caching and history tracking
- Diagnostic tools
Created by fdossi
- Based on Zotero plugin development guide
- Inspired by community requests for automated PDF attachment