> 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/en/build/knowledge-base/translate-pdf.md).

# PDF Document Translation

Use AI to translate PDF files in your knowledge base, producing translated and bilingual side-by-side PDF versions

## Feature Overview <a href="#feature-description" id="feature-description"></a>

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 <a href="#how-to-translate-pdf" id="how-to-translate-pdf"></a>

### 1. Open the Document Details Page <a href="#open-document-detail" id="open-document-detail"></a>

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 <a href="#open-translation-settings" id="open-translation-settings"></a>

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 <a href="#configure-translation-params" id="configure-translation-params"></a>

| 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 <a href="#start-translation" id="start-translation"></a>

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 <a href="#view-translation-result" id="view-translation-result"></a>

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 <a href="#result-preview" id="result-preview"></a>

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

### Download Files <a href="#download-file" id="download-file"></a>

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 <a href="#processing-details" id="processing-details"></a>

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 href="#translation-version-management" id="translation-version-management"></a>

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
