Localize a PDF Form

Edit in →

Localization capabilities enable you to adapt a PDF form to the local language of the viewer. This demo shows how to translate PDF form content to any language. English, German, Italian, French, and Spanish are available as examples. Select one of these languages from the Form language drop-down menu and click the Save as PDF button to generate a localized PDF document.

To localize a PDF form, open its JSON schema and translate visible texts in it (titles, descriptions, choice texts, placeholders). Typically, properties that specify visible texts accept string values. Instead, specify the properties with objects. Each object field should indicate a locale and the field value—a translation for this locale. Refer to the survey JSON schema (the json.js file) for a code example.

To generate a localized PDF form, assign a required locale code to the locale property of the SurveyPDF instance. For example, the following code applies the French locale:

const surveyPdf = new SurveyPDF.SurveyPDF(surveyJson, pdfDocOptions);
surveyPdf.locale = "fr";

// In modular applications:
import { SurveyPDF } from "survey-pdf";
const surveyPdf = new SurveyPDF(surveyJson, pdfDocOptions);
surveyPdf.locale = "fr";

Alternatively, you can specify the locale property within the survey JSON schema that you pass to the SurveyPDF instance:

const surveyJson = {
  // ...
  "locale": "fr"
}
const pdfDocOptions = { /* ... */ };
const surveyPdf = new SurveyPDF(surveyJson, pdfDocOptions);

Default PDF fonts support only Latin-based languages. Other languages require custom fonts.

Your cookie settings

We use cookies on our site to make your browsing experience more convenient and personal. In some cases, they are essential to making the site work properly. By clicking "Accept All", you consent to the use of all cookies in accordance with our Terms of Use & Privacy Statement. However, you may visit "Cookie settings" to provide a controlled consent.

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.