Skip to content

自定义主题色

福昕 PDF SDK Web 版提供了一个公共方法 setThemeColor,允许用户自定义主题色。具体如下:

javascript
PDFViewCtrl.shared.setThemeColor([
    {
        dom: document.body, // Applied globally.
        colors: {
            primary: "#409eff", // Optional. Sets the color for UI components like buttons and dropdowns.
            background: "#999999", // Optional. Sets the background color for pages and input fields.
            border: "", // Optional. Sets the border color. An empty string means using the default value.
            link: "#9E3ABF", // Optional. Sets the color of links.
            text: "#006ddd", // Optional. Sets the color of the text.
        },
    },
    {
        dom: document.getElementsByClassName("fv__ui-tab-nav")[0], // Applied to a specific DOM element.
        colors: {
            text: "#d96f3f"
        },
    },
]);