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

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

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

Uploaded Source

Built Distribution

pdf2zh-1.5.3-py3-none-any.whl (140.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdf2zh-1.5.3.tar.gz
  • Upload date:
  • Size: 132.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.5.3.tar.gz
Algorithm Hash digest
SHA256 2a911ce6debae6a442266ff32a487e3b7ed2c074b553340c323f30f7014dc919
MD5 258fac46d6e575eac841ebc179a346fc
BLAKE2b-256 55ee8ccd907ae7c7895a3e0ce0e33f8c311eabda6a057ccf98d13366d2f9717a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf2zh-1.5.3-py3-none-any.whl
  • Upload date:
  • Size: 140.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.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0df95a30bdc3d399c84ab61f628d858305a035d60fa1332fcb1c48cc0ec6f62d
MD5 dafcbfbde31ef45c817538cdf33c1f5b
BLAKE2b-256 ecf6768ba3885744c562bc6942a3ca421968496f8a499d844c7cff44b19cba9c

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