Changing the theme |
You can use one of already built-in themes or you can create yours.
In current version, available built-in themes are:
List of available built-in themes can be obtained by calling from Javascript:
window.TWPdfViewerUtil.getBuiltInThemes();
Must have id="tw-web-theme", otherwise it will not work changing theme through Javascript.
Directly in HTML
<link rel="stylesheet" href="/_content/Terminalworks.PdfViewer.AspNetCore/css/themes/{THEME_NAME}/tw-pdf-viewer-theme.css" id="tw-web-theme" />
Example:
<link rel="stylesheet" href="/_content/Terminalworks.PdfViewer.AspNetCore/css/themes/white-shapes/tw-pdf-viewer-theme.css" id="tw-web-theme" />
Or if you're using your custom theme:
<link rel="stylesheet" href="{URL_TO_YOUR_CSS_FILE}" id="tw-web-theme" />
From Javascript
Using one of the built-in themes:
window.TWPdfViewerUtil.changeThemeByName("{THEME_NAME}");
Example:
window.TWPdfViewerUtil.changeThemeByName("blue-circle");
or if you are using your custom theme:
window.TWPdfViewerUtil.changeThemeBySrcUrl("{URL_TO_YOUR_CSS_FILE}");
example:
window.TWPdfViewerUtil.changeThemeBySrcUrl("/css/custom-theme.css");
In both ways, every instance of TWPdfViewer on-page will be affected.
Support Availability - December 25th to December 29th, 2024
From December 25th to December 29th, 2024, our support team will be available exclusively via email.
For assistance, please contact us at [email protected], and we will respond to your inquiry as soon as possible.