Skip to content
Projects

About

PDF2zh for Zotero | Zotero PDF Chinese translation plugin

Other Projects

How these counts are measured

Measured star growth

in 24h
+9
in 7 days
+113
in 15 days
+271
in 1 month
+594

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

i18n/README.en.md

Original

Zotero PDF2zh

Zotero PDF2zh

zotero target version Using Zotero Plugin Template Downloads release License zread

Use PDF2zh and PDF2zh_next in Zotero for PDF translation

Version v4.1.8 | Old version v2.4.3

📝 Available Languages: English | 日本語 | 한국어 | Italiano | Français

Note: This translation was generated by AI and may contain inaccuracies. For the most accurate information, please refer to the original Chinese version.

How to Use This Plugin

This guide will walk you through the installation and configuration of the Zotero PDF2zh plugin.

❓ Need Help?

  • Go to the FAQ: FAQ
  • Ask basic questions (like how to install Python, conda, etc.) to AI
  • Ask in GitHub Issues
  • Current QQ groups

Installation Guide

Message to copy to your Agent

Follow the official guide at https://zotero-pdf2zh.github.io/zh/guide/agent-install.html to set up Zotero PDF2zh. Check my existing installation, help me choose a translation service, let me enter my own API key if needed, and show me how to translate one page. For a local Server, help me create and test a double-click launcher.

Step 0: Install Python and Zotero

Step 1: Install uv/conda

uv Installation (Recommended)

  1. Install uv
# Method 1: Script installation (recommended)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# Method 2: pip installation
pip install uv
  1. Verify uv installation
# If uv version is displayed, installation is complete
uv --version

conda Installation

  1. Install conda following: https://www.anaconda.com/docs/getting-started/miniconda/install#windows-command-prompt

  2. Verify conda installation

conda --version

Step 2: Download Project Files

On Windows, download server.zip, extract it and open CMD or PowerShell in the folder containing both server.py and requirements.txt. The shell commands below are for macOS/Linux.

# 1. Create and enter zotero-pdf2zh folder
mkdir zotero-pdf2zh && cd zotero-pdf2zh

# 2. Download and extract server folder
curl -fLO https://github.com/guaguastandup/zotero-pdf2zh/releases/latest/download/server.zip
unzip server.zip

# 3. Enter server folder
cd server

Step 3: Prepare Environment and Run

The Python script can automatically create virtual environments during execution, install necessary packages, and switch between virtual environments for pdf2zh and pdf2zh_next engines.

You only need to choose one virtual environment tool: uv or conda

1. If you choose uv (recommended)

# uv run will automatically create virtual environment and install required dependencies
uv run --python 3.12 --with-requirements requirements.txt server.py

2. If you choose conda

Follow these steps (execute in order, don't skip steps):

Step 1: Create main virtual environment (execute once only)

# Create a conda environment named zotero-pdf2zh-server
conda create -n zotero-pdf2zh-server python=3.12 -y

Step 2: Activate environment

conda activate zotero-pdf2zh-server

Step 3: Install dependencies

python -m pip install -r requirements.txt

Step 4: Start service

python server.py --env_tool=conda

::: danger Important The translation function depends on this Python script, you need to keep the script running. As long as you need to use the translation function, do not close this Python script window. Closing the script will disable the translation function. :::

Default Configuration

Default options when starting with python server.py:

  • Virtual environment management: Enabled
  • Environment tool: Auto-detect (uv/conda)
  • Python version: 3.12
  • Auto install dependencies: Enabled
  • Auto check updates: Enabled
  • Update source: gitee
  • Port: 8890
  • Mirror source: USTC

Common Command Line Parameters

Parameter Description Usage
Basic startup Default configuration python server.py
--port Change port number python server.py --port=9999
--check_update Auto check for updates python server.py --check_update=False
--update_source Update source selection python server.py --update_source="github"
--enable_mirror Mirror acceleration python server.py --enable_mirror=False
--mirror_source Custom mirror source python server.py --mirror_source="URL"
--enable_winexe Windows exe mode python server.py --enable_winexe=True --winexe_path="PATH"

::: tip Note

  • update_source options: github / gitee (default)
  • mirror_source default: USTC mirror :::

Notes

  • If using uv method, don't move server folder or rename it after installation (affects virtual environment path).
  • If using conda method, virtual environment is stored in conda's envs directory, server folder can be safely moved.
  • If update check fails on startup, switch update source based on network: python server.py --update_source="gitee" or python server.py --update_source="github"

Step 4: Download and Install Plugin

Download v4.1.8 here

In Zotero, open "Tools → Plugins", drag the xpi file to install. Restart Zotero if needed.

Step 5: Zotero Plugin Settings

Configuration Options

  • Switch between pdf2zh/pdf2zh_next translation engines

  • Optionally use Wenyi with matching main-source plugin and Server builds for mono or bilingual output.

Translation Engine Comparison

Feature PDF2ZH (Legacy) PDF2ZH Next (New)
Maintenance Status ❌ No longer actively maintained ✅ Continuously updated
Translation Speed ⚡ Faster Slightly slower
Custom Fonts ✅ Supports custom fonts ❌ Not supported
Config File config.json config.toml
Dual Layout Modes Basic dual layout only Supports Left&Right / Top&Bottom modes
Glossary Feature ❌ Not supported ✅ Auto-extract and use glossary
Table Translation ❌ Not supported ✅ Supports table content translation
OCR Compatibility ❌ Not supported ✅ Supports OCR compatibility & auto-OCR
Watermark Removal ❌ Not supported ✅ Supports watermark-free mode
Supported Services Relatively fewer Supports more services (including free siliconflowfree)
Upstream Project Byaidu/PDFMathTranslate PDFMathTranslate-next

::: tip Recommendation Unless you need custom fonts or require maximum speed, we recommend using PDF2ZH Next engine. :::

  • Configure qps and poolsize based on your service provider
  • Custom fonts for pdf2zh engine

Translation Services

Service Type Service Name Description
Free & No Config siliconflowfree pdf2zh_next
Free & No Config bing/google Official machine translation
Discounted openailiked Check current quotas in the provider dashboard.
Discounted silicon Invite rewards available
High Quality deepseek Good translation, cache mechanism
High Quality aliyunDashScope Good results, new user bonuses

Step 6: Translation Options

Right-click on entry/PDF in Zotero, select PDF2zh translation option.

Options:

  • Translate PDF: Generate translated PDF
  • Crop PDF: Crop and stitch for mobile reading
  • Compare PDF: Side-by-side original and translation
  • Crop-Compare PDF: For dual-column PDFs

Step 7: Package Updates (New)

Both plugin and server support auto-update. For manual updates:

In the Server directory, using the Python environment that runs the Server:

python update_packages.py

One-Click Launch Script

You can configure one-click launch for convenience:

Windows Users - Create Desktop Shortcut Script:

  1. Create a new text file on desktop, edit it with:
@echo off
cd /d "D:\zotero-pdf2zh\server" || exit /b 1
uv run --python 3.12 --with-requirements requirements.txt server.py
pause
  1. Save and rename to start-pdf2zh.bat (must have .bat extension)

  2. Double-click to start

macOS / Linux Users - Configure Alias:

  1. Edit shell config file:
# If using zsh (macOS default)
nano ~/.zshrc
# If using bash
nano ~/.bashrc
  1. Add alias at end (modify path as needed):
alias pdf2zh-start='cd /path/to/zotero-pdf2zh/server && uv run --python 3.12 --with-requirements requirements.txt server.py'
  1. Save and execute:
source ~/.zshrc
# or
source ~/.bashrc
  1. Type pdf2zh-start in terminal to launch

Frequently Asked Questions (FAQ)

About Virtual Environment

Q: uv/conda installation failed, can I skip virtual environment?

A: If you only use one engine and have Python 3.12 globally, you can disable virtual environment management:

python server.py --enable_venv=False

About Network

Q: NetworkError when attempting to fetch resource?

A:

  • Check the plugin and Server versions against the current release.
  • Keep server.py running
  • Check if port 8890 is occupied
  • Try switching ports
  • Check firewall and antivirus

Q: Translation stuck at certain point?

A: pdf2zh_next downloads assets on first run. This is slow. You can download the exe package and run once to cache assets.

About Environment

Q: DLL initialization routine failed?

A:

About Remote Services

Q: Can I use without API configuration?

A: Only free services like siliconflowfree or bing/google work without API.

Q: Too many tokens consumed?

Check actual usage in the provider dashboard; glossary extraction and retries can increase it.

About Plugin Features

Q: Scanned PDF detected, translation failed?

A: The plugin doesn't provide OCR. Use other tools to OCR your scanned PDF first.

About Asking Questions

Q: How to troubleshoot effectively?

A:

  • Read the guide carefully
  • Copy terminal output to txt
  • Screenshot Zotero settings
  • Share all three in QQ group with: what you've checked, methods tried, tutorials watched

Acknowledgments

Contributors

Thanks to all contributors!

How to Support Me

💐 Free and open-source plugin, your support keeps me going!

Star History

Explore related projects

Loading…