On this page
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);
})
});
Name | Required | Type | Accepted Values | Description |
---|---|---|---|---|
language | yes | string | zh-CN / en | languages of WebViewer |