Who it is forA translator, reviewer or bid team lead who has a translated PDF and needs proof it matches the original before sending it out.
The problemTranslated pages can drift in page count or size, lose clause numbers, change figures, or contain filler text such as placeholders, and these errors are easy to miss by eye.
The outcomeA JSON audit report and side-by-side PNG images that show which pages pass and which pages need fixes.
What you need first
- Python with pip installed
- Git to clone the repository
- Playwright Chromium installed with `playwright install chromium`, or Microsoft Edge on Windows
- The original PDF to translate or audit
- An AI agent or language model that can write HTML and run Python commands, if you want the translation step done for you
Steps
- Clone the repository with
git clone https://github.com/lxsssssss/pdf-translate.gitand enter it withcd pdf-translate. - Install dependencies with
pip install -r requirements.txtandplaywright install chromium. - Run the audit with
python scripts/audit_pdf.py --src original.pdf --tgt translated.pdf --json audit_report.json. - Generate side-by-side images with
python scripts/audit_pdf.py --src original.pdf --tgt translated.pdf --compare-png compare_png/. - Open audit_report.json and the images in compare_png/, then fix any flagged page and rerun the audit.
Prompt for your agent
Use the pdf-translate repository to audit <translated.pdf> against <original.pdf>. Run scripts/audit_pdf.py with --json audit_report.json and --compare-png compare_png/, then summarize page count, page size, clause number, cross reference and number differences from the report. Confirm that the total page count matches before reporting anything else.
Caveat. The audit checks clause numbers, cross references, numbers and placeholder wording; the README does not say it scores translation quality.
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page