Some test text!

Loading...
Guides

Internationalization: changing the language in PDF Viewer

This JavaScript sample lets you change the language displayed in tooltips when viewing documents in PDF Viewer. Compatible with all browsers (including IE11) and mobile devices without using plug-ins. Launch the Internationalization Demo to see an example of how you can toggle between English, French and Chinese Simplified in WebViewer. Learn more about our JavaScript PDF Library.

Get Started Samples Download

To run this sample, get started with a free trial of PDFTron SDK.

JavaScript

HTML

WebViewer(
  {
    path: '../../../lib',
    webviewerServerURL: 'https://demo.pdftron.com/', // comment this out to do client-side only
    initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf',
  },
  document.getElementById('viewer')
).then(instance => {
  samplesSetup(instance);
  document.getElementById('form').onchange = e => {
    // Set language
    instance.UI.setLanguage(e.target.id);
  };
});