zotero-pdf2zh is an application consisting of a Zotero plugin (TypeScript) and a companion Python Flask server that together enable in-place PDF translation within Zotero. The plugin adds a right-click menu to Zotero items — Translate, Crop, Compare, Crop-Compare — and communicates with the local server via HTTP. The server manages a dedicated Python virtual environment (using uv or conda) that runs either the legacy `pdf2zh` or the recommended `pdf2zh_next` CLI translation engine. The server exposes REST endpoints for translation, cropping, comparison, file download, and SSE-based progress tracking, and supports over 20 LLM translation services (OpenAI, DeepSeek, Gemini, etc.) via user-configured API keys. The system includes Docker deployment, Windows/macOS automation (monitors, right-click scripts), auto-updates, and a bilingual VitePress documentation site. Despite being primarily a software application, it has a strong data-processing character in its PDF manipulation and LLM orchestration layers, but the overall architecture is clearly a client-server addon, not a data analytics project.
pymupdf4llm is a library and CLI tool that converts PDFs (and other documents) into clean Markdown, JSON, plain text, or layout-aware chunks specifically optimized for LLM and RAG workflows. It provides a high-level API (`to_markdown`, `to_json`, `to_text`, `to_chunks`) that internally uses either a legacy heuristic approach or an optional GNN-based layout parser (via `pymupdf-layout`) to extract text, tables, images, and reading order. The repository also includes a deterministic chunking pipeline that uses only PDF-native layout signals (box boundaries, font jumps, vertical gaps) to produce context-preserving chunks without embeddings. OCR support is built-in, with a hybrid decision model (ONNX-based) that selectively applies Tesseract, RapidOCR, or PaddleOCR to pages that need it. Framework integrations for LlamaIndex and LangChain are provided. The architecture is primarily a monolithic library with two parallel conversion paths (legacy and layout-based), a chunking subpackage, an OCR subsystem with abstract backends, and a batch converter for large-scale processing. While the code is generally well-structured, the presence of two parallel conversion paths and tight coupling to PyMuPDF internals introduce some maintenance risk.