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 Chinese 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.3.3.tar.gz (130.1 kB view details)

Uploaded Source

Built Distribution

pdf2zh-1.3.3-py3-none-any.whl (138.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdf2zh-1.3.3.tar.gz
  • Upload date:
  • Size: 130.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.3.3.tar.gz
Algorithm Hash digest
SHA256 90dfb0d38466308255262acc1d6855e33bf243a0c20cd7bbfbd729d67713e03c
MD5 1adc0df3cdad66c3d8f09953686eafd8
BLAKE2b-256 b0277cf537fb5529bd47df09e70f52e8de1eaf11cea389904af3c9539d30d917

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdf2zh-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 138.7 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.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3cafc55ef17c99bbce8dcd9d1ef0d3e51cb7ff276caed8586dca7a46f8d80c52
MD5 d5f8f1366c751f7d789e4de5e36786a2
BLAKE2b-256 17e6be890e47ec569f5f2ee3a2ddb3ec9f38548983f9ab1325bf8b97e74b5cd1

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