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

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

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.3

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.3.tar.gz (142.8 kB view details)

Uploaded Source

Built Distribution

pdf2zh-1.6.3-py3-none-any.whl (151.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdf2zh-1.6.3.tar.gz
  • Upload date:
  • Size: 142.8 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.3.tar.gz
Algorithm Hash digest
SHA256 aa42602e0a6a5bd6421fd6c7db41a7a8f38010dec215d5234d806be0704a00da
MD5 3ee9794450b34ab87c437df3508edf13
BLAKE2b-256 ce06f8357afcd87741316bddea70e972ea760a3c10b3dd3cb61c39d61bf82d1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf2zh-1.6.3-py3-none-any.whl
  • Upload date:
  • Size: 151.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b750a6fa542948d8abce37d03d006913b88b040723bf8f3e73dcfd4dfab7ef68
MD5 4bd6dd0593f03c0656ebac857ab8dead
BLAKE2b-256 1b1de52d6d37694da8628e5550249b74d4d240172673288ab6e6783fe483a5e9

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