Resource Base
Table of contents

Viewer Config

The viewer configurations and styles are configured by viewerConfig when creating the viewer.

Structure

Each viewer class has its own viewerConfig structure. Please refer to the links below and check the details.

CustomViewer does not have viewerConfig.

Default viewerConfig

DDV will provide the default viewerConfig for each viewer.

EditViewerConfig

{
    canvasStyle: {
        background: "#e2e1de",
        cursor: "default",
    },
    pageStyle: {
        background: "#fff",
        border: "1px solid #707070",
    },
    currentPageStyle: {
        background: "",
        border: "",
    },
    quadSelectionStyle: {
        background: "rgba(255,255,255,0)",
        border: "2px solid #fe8e14",
        ctrlBackground: "#fe8e14",
        ctrlBorder: "2px solid #fe8e14",
        ctrlBorderRadius: "50%",
        ctrlHeight: "15px",
        ctrlWidth: "15px",
        invalidBorderColor: "red",
        invalidCtrlBorderColor: "red",
    },
    minZoom: 0.01,
    maxZoom: 64,
    scrollDirection: "vertical",
    enableSlide: true,
    scrollToLatest: false,
};

ThumbnailConfig

Mobile

{
    canvasStyle: {
        background: "#4B4B4B",
        cursor: "default",
    },
    currentPageStyle: {
        border: "4px solid #fe8e14",
    },
    pageStyle: {
        border: "8px solid rgba(0,0,0,0)",
        background: "rgba(255,255,255,0)",
    },
    selectedPageStyle: {
        border: "6px solid #AAAAAA",
        background: "#AAAAAA",
    },
    hoveredPageStyle: {
        border: "6px solid #AAAAAA",
        background: "#AAAAAA",
    },
    placeholderStyle: {
        border: "6px solid rgba(136,136,136,0.2)",
        background: "rgba(136,136,136,0.2)",
    },
    pageNumberStyle: {
        background: "rgba(255,255,255,0)",
        border: "0px solid #000",
        borderRadius: "0px",
        bottom: "3px",
        color: "white",
        fontFamily: "Open Sans",
        fontSize: "14px",
        height: "24px",
        left: "50%",
        onPage: false,
        opacity: 1,
        right: "",
        top: "",
        translateX: "-50%",
        translateY: "0px",
        visibility: "visible",
        width: "32px",
    },
    checkboxStyle: {
        background: "#fff",
        border: "2px solid #999999",
        borderRadius: "0px",
        bottom: "",
        checkMarkColor: "#FE8E14",
        checkMarkLineWidth: "2px",
        height: "16px",
        left: "2px",
        opacity: 1,
        right: "",
        top: "2px",
        translateX: "0px",
        translateY: "0px",
        visibility: "visible",
        width: "16px",
    },

    rows: 3,
    columns: 2,
    multiselectMode: false,
    scrollToLatest: false,
    enableDragPage: true,

    scrollDirection: "vertical",
    visibilty: "hidden",
    size: "100%",
    position: "left",
};

Desktop

{
    canvasStyle: {
        background: "#DDDDDD",
        cursor: "default",
    },
    currentPageStyle: {
        border: "4px solid #fe8e14",
    },
    pageStyle: {
        border: "8px solid rgba(0,0,0,0)",
        background: "rgba(255,255,255,0)",
    },
    selectedPageStyle: {
        border: "6px solid #AAAAAA",
        background: "#AAAAAA",
    },
    hoveredPageStyle: {
        border: "6px solid #AAAAAA",
        background: "#AAAAAA",
    },
    placeholderStyle: {
        border: "6px solid rgba(136,136,136,0.2)",
        background: "rgba(136,136,136,0.2)",
    },
    pageNumberStyle: {
        background: "rgba(255,255,255,0)",
        border: "0px solid #000",
        borderRadius: "0px",
        bottom: "3px",
        color: "#323234",
        fontFamily: "Open Sans",
        fontSize: "14px",
        height: "24px",
        left: "50%",
        onPage: false,
        opacity: 1,
        right: "",
        top: "",
        translateX: "-50%",
        translateY: "0px",
        visibility: "visible",
        width: "32px",
    },
    checkboxStyle: {
        background: "#fff",
        border: "2px solid #999999",
        borderRadius: "0px",
        bottom: "",
        checkMarkColor: "#FE8E14",
        checkMarkLineWidth: "2px",
        height: "16px",
        left: "2px",
        opacity: 1,
        right: "",
        top: "2px",
        translateX: "0px",
        translateY: "0px",
        visibility: "visible",
        width: "16px",
    },

    rows: 4,
    columns: 1,
    multiselectMode: false,
    scrollToLatest: false,
    enableDragPage: true,
    scrollDirection: "vertical",
    visibilty: "hidden",
    size: "180px",
    position: "left",
};

CaptureViewerConfig

{
    canvasStyle: {
        background: "#e2e1de",
        cursor: "default",
    },
    quadSelectionStyle: {
        border: "2px solid #fe8e14",
        background: "rgba(255,255,255,0)",
    },

    enableAutoCapture: false,
    enableAutoDetect: false,
    enableTorch: false,
    maxFrameNumber: 10,
    autoCaptureDelay: 1000,
    acceptedPolygonConfidence: 80,
};

PerspectiveViewerConfig

{
    canvasStyle: {
        background: "#e2e1de",
        cursor: "default",
    },
    pageStyle: {
        border: "1px solid #707070",
        background: "#fff",
    },
    quadSelectionStyle: {
        border: "2px solid #fe8e14",
        background: "rgba(255,255,255,0)",
        ctrlBorderRadius: "50%",
        ctrlBackground: "#fe8e14",
        ctrlBorder: "2px solid #fe8e14",
        ctrlWidth: "15px",
        ctrlHeight: "15px",
        invalidCtrlBorderColor: "red",
        invalidBorderColor: "red",
    },
    enableSlide: true,
};

BrowseViewerConfig

{
    canvasStyle: {
        background: "#e2e1de",
        cursor: "default",
    },
    currentPageStyle: {
        border: "4px solid #fe8e14",
    },
    pageStyle: {
        border: "8px solid rgba(0,0,0,0)",
        background: "rgba(255,255,255,0)",
    },
    selectedPageStyle: {
        border: "6px solid #AAAAAA",
        background: "#AAAAAA",
    },
    hoveredPageStyle: {
        border: "6px solid #AAAAAA",
        background: "#AAAAAA",
    },
    placeholderStyle: {
        border: "6px solid rgba(136,136,136,0.2)",
        background: "rgba(136,136,136,0.2)",
    },
    pageNumberStyle: {
        background: "rgba(255,255,255,0)",
        border: "0px solid #000",
        borderRadius: "0px",
        bottom: "3px",
        color: "#323234",
        fontFamily: "Open Sans",
        fontSize: "14px",
        height: "24px",
        left: "50%",
        onPage: false,
        opacity: 1,
        right: "",
        top: "",
        translateX: "-50%",
        translateY: "0px",
        visibility: "visible",
        width: "32px",
    },
    checkboxStyle: {
        background: "#fff",
        border: "2px solid #999999",
        borderRadius: "0px",
        bottom: "",
        checkMarkColor: "#FE8E14",
        checkMarkLineWidth: 2,
        height: "16px",
        left: "2px",
        opacity: 1,
        right: "",
        top: "2px",
        translateX: "0px",
        translateY: "0px",
        visibility: "visible",
        width: "16px",
    },
    rows: 2,
    columns: 2,
    multiselectMode: false,
    scrollToLatest: false,
    enableDragPage: true,
    scrollDirection: "vertical",
};

Developers can customize it to achieve their own requirement. Please refer to How to customize viewer.

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support