> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/km/translate-pdf.md).

# PDF Document Translation

## Feature Overview

MaiAgent provides AI-powered PDF document translation, allowing you to translate PDF files in your knowledge base into a specified language. After translation, two versions are produced:

* **Translated version**: Contains only the translated content in the target language
* **Bilingual side-by-side version**: Displays the original text and translation side by side for easy comparison

Supported languages include: Traditional Chinese, Simplified Chinese, English, Japanese, Korean, Spanish, French, German, Portuguese, Russian, Arabic, Italian, Dutch, Polish, and Turkish.

{% hint style="info" %}
Currently, only PDF format is supported for document translation, and the PDF must contain extractable text content (scanned/image-only PDFs are not supported).
{% endhint %}

***

## How to Translate a PDF Document

### 1. Open the Document Details Page

In the <mark style="color:blue;">Documents</mark> tab of your knowledge base, click the PDF file you want to translate to open the document details page.

### 2. Open Translation Settings

Click the <mark style="color:blue;">Translate PDF</mark> button in the upper right corner. If the file already has a translation record, the translation results dialog will appear first — click <mark style="color:blue;">Translate Again</mark> to open the settings. For first-time translations, the translation settings dialog opens directly.

### 3. Configure Translation Parameters

| Field                         | Description                                                                                                       |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **Source Language**           | The language of the original text. Defaults to "Auto Detect" — the system identifies it automatically             |
| **Target Language**           | The target language for translation (required)                                                                    |
| **Large Language Model**      | Select the LLM model to use for translation                                                                       |
| **Custom Terminology/Prompt** | (Optional) Guide the translation style or specify terminology mappings, e.g., "Translate 'Hermione' as 'Miao-Li'" |

{% hint style="info" %}
The custom prompt supports up to 5,000 characters and is ideal for specifying proper nouns, brand names, or particular translation styles.
{% endhint %}

### 4. Start Translation

Click <mark style="color:blue;">Confirm</mark> to start the translation task in the background. The status updates in real time during translation, and results are displayed automatically upon completion.

***

## View Translation Results

After translation is complete, click the <mark style="color:blue;">Translate PDF</mark> button to open the translation results dialog, which contains three tabs:

### Result Preview

Preview the bilingual side-by-side PDF with the original text and translation displayed side by side.

### Download Files

Three file download options are available:

* **Original file**: Download the untranslated original PDF
* **Translated version**: A PDF containing only the target language translation
* **Bilingual side-by-side version**: A PDF with the original text and translation displayed side by side

### Processing Details

View complete statistics for the translation task:

* **Translation configuration**: Source/target languages, LLM model used
* **Processing statistics**: Token consumption, number of LLM calls, processing time breakdown
* **File information**: File size and character count for both the original and translated files
* **Timestamps**: Creation, start, and completion times along with the final status

***

## Translation Version Management

A single PDF file can be translated multiple times (e.g., into different languages or using different models), and each translation is saved as a separate version.

Use the <mark style="color:blue;">Select Translation Version</mark> dropdown at the top of the translation results dialog to switch between versions. The version format is: `Date | Source Language → Target Language | Model Used`.

To translate again, click the <mark style="color:blue;">Translate Again</mark> button to open a new translation settings dialog.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/km/translate-pdf.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
