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

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

Uploaded Source

Built Distribution

pdf2zh-1.4.1-py3-none-any.whl (139.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdf2zh-1.4.1.tar.gz
  • Upload date:
  • Size: 130.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.4.1.tar.gz
Algorithm Hash digest
SHA256 ed89ba30bbb462a1ca15f0403a8232eed8e41f8de392cfbe1d9e51a6ef425445
MD5 8d1c8fe55a7be930301efe12f6a2ca3c
BLAKE2b-256 999d98cec5fdf931736a66873efd22aa1a64f119467a33f4d4545ebd6e43dc23

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf2zh-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 139.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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7cc18501e964657580484df1d6f3f452bea6d9af45d956dd1d6fedbde0c540aa
MD5 aeeec3bf87639ffd783a674cac7e51e4
BLAKE2b-256 e24bd775fd972d02625a1184825457eef9668bd5fe89d1a2ad3a18ffb0669ebc

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