Skip to content
Guides

Set Language

ComPDFKit for Web supports setting the language of UI.

javascript
// Import the JS file of ComPDFKit Demo.
import ComPDFKitViewer from "/@compdfkit/webviewer";

const viewer = document.getElementById('webviewer');
ComPDFKitViewer.init({
  pdfUrl: 'Your PDF Url',
  license: 'Input your license here'
}, viewer)
  .then((core) => {
    const docViewer = core.docViewer;
    const { UI } = core;
    docViewer.addEvent('documentloaded', () => {
      console.log('ComPDFKit Web Demo loaded');

      const language = 'zh-CN';
      UI.setLanguage(language);
    })
  });
NameRequiredTypeAccepted ValuesDescription
languageyesstringzh-CN / enlanguages of WebViewer