# AI use cases for PDF Translate (lxsssssss/pdf-translate)

Repo: [lxsssssss/pdf-translate](https://github.com/lxsssssss/pdf-translate) | Use cases: 3 | Page: https://dedupedai.com/use-cases/lxsssssss-pdf-translate/

A Python agent skill that rebuilds a translated document as a layout-preserving vector PDF through a headless browser, then audits the result against the original PDF.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Check a translated PDF against its original page by page: https://dedupedai.com/use-cases/lxsssssss-pdf-translate/audit-translated-pdf-against-original/
- Turn a translated HTML layout into a vector PDF with overflow checks: https://dedupedai.com/use-cases/lxsssssss-pdf-translate/render-html-translation-to-vector-pdf/
- Have an AI agent translate an official PDF and keep its layout: https://dedupedai.com/use-cases/lxsssssss-pdf-translate/agent-translates-official-pdf-with-layout-kept/

## How to check a translated PDF against its original page by page with PDF Translate

Repo: [lxsssssss/pdf-translate](https://github.com/lxsssssss/pdf-translate) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Run the audit script to compare page count, page size, clauses, numbers and placeholder wording.

**Who it is for:** A translator, reviewer or bid team lead who has a translated PDF and needs proof it matches the original before sending it out.

**The problem:** Translated 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 outcome:** A JSON audit report and side-by-side PNG images that show which pages pass and which pages need fixes.

### Steps

1. Clone the repository with `git clone https://github.com/lxsssssss/pdf-translate.git` and enter it with `cd pdf-translate`.
2. Install dependencies with `pip install -r requirements.txt` and `playwright install chromium`.
3. Run the audit with `python scripts/audit_pdf.py --src original.pdf --tgt translated.pdf --json audit_report.json`.
4. Generate side-by-side images with `python scripts/audit_pdf.py --src original.pdf --tgt translated.pdf --compare-png compare_png/`.
5. Open audit_report.json and the images in compare_png/, then fix any flagged page and rerun the audit.

### Prompt to paste into your agent

```text
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.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lxsssssss-pdf-translate/audit-translated-pdf-against-original/

## How to turn a translated HTML layout into a vector PDF with overflow checks with PDF Translate

Repo: [lxsssssss/pdf-translate](https://github.com/lxsssssss/pdf-translate) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Render HTML with Playwright into a selectable, searchable PDF and stop if any page overflows.

**Who it is for:** A developer or agent operator who already has a translated HTML file laid out with CSS @page rules and needs a print-ready PDF.

**The problem:** Longer translated text can overflow the page height and push content onto extra blank or broken pages when printed.

**The outcome:** A vector PDF that keeps text selectable, or a failed run that reports the overflow so the HTML can be fixed before a PDF is written.

### Steps

1. Clone the repository with `git clone https://github.com/lxsssssss/pdf-translate.git` and enter it with `cd pdf-translate`.
2. Install dependencies with `pip install -r requirements.txt` and `playwright install chromium`.
3. Place your translated HTML file in the project folder and name it input.html.
4. Render it in strict mode with `python scripts/render_pdf.py input.html output.pdf --strict-overflow`.
5. If the command exits with code 2, fix the reported overflow in the HTML and run the render command again.

### Prompt to paste into your agent

```text
In the pdf-translate repository, render <input.html> to <output.pdf> using scripts/render_pdf.py with --strict-overflow. If the exit code is 2, edit the HTML to remove the reported page overflow and render again. Verify that output.pdf exists and has the expected page count before finishing.
```

### Caveat

The renderer takes an HTML file as input, so the translation and layout into HTML must already exist; the README does not describe a command that produces that HTML from a PDF.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lxsssssss-pdf-translate/render-html-translation-to-vector-pdf/

## How to have an AI agent translate an official PDF and keep its layout with PDF Translate

Repo: [lxsssssss/pdf-translate](https://github.com/lxsssssss/pdf-translate) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Use the skill's two-stage SOP so an agent extracts clauses first, then renders and audits the result.

**Who it is for:** A business or bid team member translating a tender, qualification certificate or contract who wants an AI agent to run the full workflow.

**The problem:** A general translation tool can break tables, clause numbering and page size, and a model may rewrite or drop clauses without warning.

**The outcome:** A translated PDF in the original page layout, with a clause and number audit report and a comparison image set.

### Steps

1. Clone the repository into your coding agent's skill folder, for Claude Code use `git clone https://github.com/lxsssssss/pdf-translate.git .claude/skills/pdf-translate`.
2. Install dependencies with `pip install -r requirements.txt` and `playwright install chromium` inside the cloned folder.
3. Ask the agent to translate your PDF into the target language, keep its layout and output a PDF, following SKILL_EN.md.
4. Let the agent render its HTML with `python scripts/render_pdf.py input.html output.pdf --strict-overflow`.
5. Let the agent audit the result with `python scripts/audit_pdf.py --src original.pdf --tgt output.pdf --strict --json audit_report.json` and review any failures. (inferred, check the README)

### Prompt to paste into your agent

```text
Using the pdf-translate skill in .claude/skills/pdf-translate, translate <original.pdf> into <target language> while keeping its layout, following SKILL_EN.md. Render the HTML with scripts/render_pdf.py using --strict-overflow, then audit the output against <original.pdf> with scripts/audit_pdf.py using --strict and --json audit_report.json. Verify that the audit report shows matching page count and page sizes before you say the job is done.
```

### Caveat

The README describes the translation as written by the agent under SKILL_EN.md, so output quality depends on the model and still needs human review before official use.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/lxsssssss-pdf-translate/agent-translates-official-pdf-with-layout-kept/
