Skip to content
ComPDF
Guides

Theming & Styles

ComPDFKit_Tools provides two levels of theme configuration: Global Theme Mode and Reader Theme.

Global Theme Mode (themeMode)

GlobalConfig.themeMode controls the overall appearance of UI components:

json
{
  "global": {
    "themeMode": "system"
  }
}
ValueDescription
"light"Light mode
"dark"Dark mode
"system"Follow system settings

This configuration affects the color scheme of all UI components including toolbars, dialogs, and property panels.

Reader Theme (themes)

ReaderViewConfig.themes controls the background and rendering theme of the PDF reading area:

json
{
  "readerViewConfig": {
    "themes": "light"
  }
}
ValueDescription
"light"White background
"dark"Dark background
"sepia"Eye-comfort (warm tone) background
"reseda"Green eye-comfort background

Differences Between the Two

Dimensionglobal.themeModereaderViewConfig.themes
ScopeUI components (toolbars, dialogs, etc.)PDF document rendering area
Valueslight, dark, systemlight, dark, sepia, reseda
Typical UseAdapt to system dark modeProvide eye-comfort reading mode

The two can be configured independently. For example, you can have the UI follow system dark mode while the reading area uses the eye-comfort theme:

json
{
  "global": {
    "themeMode": "system"
  },
  "readerViewConfig": {
    "themes": "sepia"
  }
}

Custom Theme Colors

For further color scheme customization, you can override the color values defined by ComPDFKit_Tools in Android resource files. The Tools module uses the standard Android resource system — simply define color values with the same names in your app's res/values/colors.xml and res/values-night/colors.xml to override them.