> For the complete documentation index, see [llms.txt](https://help.form.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.form.io/form-building/pdf-forms/dynamic-pdf-translation/resource-based-pdf-translation.md). Agents can also search and read this documentation through its [MCP server](https://help.form.io/~gitbook/mcp).

# Resource-Based PDF Translation

## Overview <a href="#overview" id="overview"></a>

Resource-based PDF Translation loads PDF translations from a Form.io Language resource. Each submission in the resource holds the translations for one language. When a submission PDF is generated, the PDF Server selects the language and loads the matching translations from the resource.

Because translations are stored as resource submissions, anyone with access to the resource can add or update them in the Form.io portal without changing files or application code. The same Language resource can also provide translations for live forms.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* API Server 9.12.0 or later and PDF Server 5.17.0 or later.
* A Language resource in the same project, with one submission for each language you want to support.

## Setting Up the Language Resource <a href="#setting-up-the-language-resource" id="setting-up-the-language-resource"></a>

If a Language resource already exists, it can be applied to submission PDFs as well.

If one needs to be created, complete the following steps:<br>

1. Create a Language resource within the Project, called **Language.**
2. Within this resource, add a **Select Field** (typically called "Language") for the Language Code.\
   This maps the plaintext language name to the language identifier.
3. Within the Select Field's **Data tab**, set **Data Source** to *Value&#x73;**.***
4. For each language the form is localized to, create a **Label** identifying the plantext language name, and a **Value** identifying the language identifier.

![](https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2F3wswGOtjfgyfjfjCWYKd%2Fimage.png?alt=media\&token=4289b150-dc60-4e74-a88d-c5cf8e49aa50)

5. Add a **Data Map** to the Language Resource (typically called "Translation"), which contains **Text Field** that maps the default language text to the translated text, like the following:

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FqqTpchObfCi5xZtHYqqT%2Fimage.png?alt=media&amp;token=ca5303c1-9f00-4c87-a03c-736aa6d7dab5" alt=""><figcaption></figcaption></figure>

The completed resource will look like the following:

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FHc3HD3ggaIMEcF9OO4vp%2Fimage.png?alt=media&amp;token=aced0963-014d-4261-a946-f74ae4f8d277" alt=""><figcaption></figcaption></figure>

6. Press **Create Resource** button to create the new Resource.

{% hint style="warning" %}
Form.io expects Language Resources to adhere to this basic format. While labels may change, using unexpected components or layouts will prevent the translations from being located within the resource.
{% endhint %}

### Filling the Language Resource

Once this is created, use the resource to create a new submission for each translation. The following example illustrates the fields for Español:

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FQZufVy1OMGdpuuqmwQzy%2Fimage.png?alt=media&amp;token=e75b48d6-f502-4926-82b5-c49f596a8bdd" alt=""><figcaption></figcaption></figure>

Each submission will add the "language". This will be used to manage all of the translations in a standard way. Input the rest of the language translations the same way until there are multiple to choose from.

### Language Resource "Read All Submissions" Access

For most applications, the end user will be authenticated when they are switching between languages. In some cases, the user may be anonymous. As with any resource, ensure that the proper Role has access to the *Read All Submissions* permission within the **Access** section of the Language form.

### Configuring the Form <a href="#configuring-the-form" id="configuring-the-form"></a>

1. Open the form and go to **Form Settings**.
2. In the **PDF Settings** section, set **PDF Translation Method** to **Form.io Language Resource:**

<figure><img src="https://501951130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6LdEf8SjBIeQDsRL3BdV%2Fuploads%2FSbF1PQAg3WIC0e2zpawV%2Ftranslation_form_settings.png?alt=media&amp;token=6f0130a0-9920-4051-b1b7-4797f63434b2" alt=""><figcaption></figcaption></figure>

3. Complete the following settings:

| Setting                       | Description                                                                                                                                                       |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Form.io Language Resource** | Select the Form.io Resource providing the desired language options and translation mappings that will be passed to the PDF Server when rendering PDF submissions. |
| **Language Code Component**   | Select the Form.io component within the Language resource providing the language code.                                                                            |
| **Translation Map Component** | Select the Form.io component within the Language resource providing the translation mapping.                                                                      |

The component lists show each component as **Label (API key)**, for example **Language Code (languageCode)** and **Translations (translations)**.

4. Save the form settings.

### Testing <a href="#testing" id="testing"></a>

Download a submission PDF and add the `language` parameter with a language code from your resource, for example `?language=es`.

The value of `language` must match a value of the **Language Code Component** in one of the resource's submissions.


---

# 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://help.form.io/form-building/pdf-forms/dynamic-pdf-translation/resource-based-pdf-translation.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.
