Skip to main content

Latex PDF Translator

Project description

PDFMathTranslate

PDF scientific paper translation and bilingual comparison based on font rules and deep learning, preserving formula and figure layout.

image

image

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

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

Hint: Starting from \ufb00 is English style ligature.

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

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

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

Uploaded Source

Built Distribution

pdf2zh-1.6.2-py3-none-any.whl (151.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdf2zh-1.6.2.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.2.tar.gz
Algorithm Hash digest
SHA256 b5fb04af35def9ab278b64ef51952e1a62c938b5c42649988e79f7d2c0e49c65
MD5 63d108f2ac770359d166b18365f905aa
BLAKE2b-256 2037da94da32c5fc1d4991913619fdb39d59a869a23ebd0bdca26503b2609f77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf2zh-1.6.2-py3-none-any.whl
  • Upload date:
  • Size: 151.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d5da562c6cb337730ca72b3ec0f761ea57f3957611b0de248d6dbb301d17298
MD5 b673d04774fe6c65156e03cc684ab512
BLAKE2b-256 002c306d4a755f2d9f37b5875b18887b2abcd4a13e26b9f6ab51649cddaddc36

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