Some test text!


Changing themes & colors using JavaScript

You can change the color theme by either using an API or providing a path to a custom CSS file in the constructor.

linksetTheme API

The API allows you to change the theme on the fly. See setTheme for details.

linkCSS variables

The other option is to use a custom stylesheet to define the CSS color variables.


  licenseKey: 'YOUR_LICENSE_KEY',
  path: 'lib',
  css: 'path/to/stylesheet.css'
}, document.getElementById('viewer'));
:root {
  --primary-color: #1C242E;
  --secondary-color: #6F8BA7;
  --text-color: #FFFFFF;
  --button-hover-color: #414C59;
  --button-active-color: #414C59;
  --icon-color: #FFFFFF;

Dark theme

linkOther properties

See the customizing styles for more information about customizing other properties.

Get the answers you need: Support


Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

Join our live demo to learn about use cases & capabilities for WebViewer

Learn more