Changing the Viewer Theme
Our sample projects and report templates can help you learn the basics of working with our products.The Python viewer's appearance — interface theme, background color and toolbar layout — is set through its options object.
Set the theme and appearance options.
How it works. The options object drives the viewer's look, so a couple of assignments reskin the entire preview.
Set the theme and appearance options.
viewer = StiViewer()
viewer.options.appearance.theme = enums.StiViewerTheme.OFFICE_2022_BLACK_GREEN
viewer.options.appearance.backgroundColor = 'black'
viewer.options.toolbar.displayMode = enums.StiToolbarDisplayMode.SEPARATEDappearance.theme— one of theStiViewerThemepresets that restyles the whole viewer UI.appearance.backgroundColor/toolbar.displayMode— the page background and toolbar layout.
How it works. The options object drives the viewer's look, so a couple of assignments reskin the entire preview.