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

Multi-threaded translation: MathTranslate

Layout parsing: LayoutParser

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

Uploaded Source

Built Distribution

pdf2zh-1.4.9-py3-none-any.whl (140.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pdf2zh-1.4.9.tar.gz
Algorithm Hash digest
SHA256 732c7a8a9f7502235f4dbe64fd0748b5e21bfebbe36d151f087da1f69761b4d7
MD5 2ce77def36c3e035af33ee52e3885e9f
BLAKE2b-256 e850eeba2b5760e3426c159e237345aa80c44408351342e8567419787ab28901

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf2zh-1.4.9-py3-none-any.whl
  • Upload date:
  • Size: 140.6 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.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 17dfdeee3aa3868ad993bcebbad08230bc8a62a1eb2967b0ee97f771e6a2ded1
MD5 02259f5662f93d315c45f6c77d28d539
BLAKE2b-256 8b713e544e218b462d44d78a8cbcdd4df2e4c5fb48c8745368d7d1e92539c857

See more details on using hashes here.

Supported by

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