Skip to main content

Latex PDF Translator

Project description

PDFMathTranslate

PDF scientific paper translation and bilingual comparison.

  • 📊 Retain formulas and charts.

  • 📄 Preserve table of contents.

  • 🌐 Support multiple translation services.

Installation

pip install pdf2zh

Usage

Execute the translation command in the command line to generate the translated document example-zh.pdf and the bilingual document example-dual.pdf in the current directory.

Translate the entire document

pdf2zh example.pdf

Translate part of the document

pdf2zh example.pdf -p 1-3,5

Translate with the specified language

See Languages Codes.

pdf2zh example.pdf -li en -lo ja

Translate with Ollama

See Ollama.

pdf2zh example.pdf -s gemma2

Use regex to specify formula fonts and characters that need to be preserved

pdf2zh BDA3.pdf -f "(CM[^RT].*|MS.*|XY.*|MT.*|BL.*|.*0700|.*0500|.*Italic)" -c "(\(|\||\)|\+|=|\d|[\u0080-\ufaff])"

Preview

image

image

image

Acknowledgement

Document merging: PyMuPDF

Document parsing: Pdfminer.six

Document extraction: MinerU

Multi-threaded translation: MathTranslate

Layout parsing: DocLayout-YOLO

Star History

Star History Chart

Project details


Release history Release notifications | RSS feed

This version

1.6.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf2zh-1.6.5.tar.gz (143.1 kB view details)

Uploaded Source

Built Distribution

pdf2zh-1.6.5-py3-none-any.whl (151.5 kB view details)

Uploaded Python 3

File details

Details for the file pdf2zh-1.6.5.tar.gz.

File metadata

  • Download URL: pdf2zh-1.6.5.tar.gz
  • Upload date:
  • Size: 143.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pdf2zh-1.6.5.tar.gz
Algorithm Hash digest
SHA256 2851a86e571f37940f3c0097a281c674ddee2055606a7fd1b132c06cfa4c4b3e
MD5 a61c8c1050a92133cde2b5fca8337c9b
BLAKE2b-256 b1393a6ee5ab89e9b970a67cec599549521d7fd5f8a3c63b4dda3b9f2e691dea

See more details on using hashes here.

File details

Details for the file pdf2zh-1.6.5-py3-none-any.whl.

File metadata

  • Download URL: pdf2zh-1.6.5-py3-none-any.whl
  • Upload date:
  • Size: 151.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pdf2zh-1.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d843e2a04734916ccf248b3b65d22b2392ce53435adbc182c31a277c1e098532
MD5 2f4732878a378429b80d776f126e19fc
BLAKE2b-256 1026357ba043b8933b1f47b1feaef1433810726104ad42532b80c1536cc34f5e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page