ComPDFKit Web SDK
    Preparing search index...

    Interface Panel

    A panel returned by UI.getPanels(). Changing its dataElement, render or location, or calling setLocation / delete, updates the panel in the viewer right away.

    const stylePanel = instance.UI.getPanels().find(panel => panel.dataElement === instance.UI.Panels.STYLE);
    stylePanel.setLocation('left');
    interface Panel {
        dataElement: string;
        delete(): void;
        location: string | undefined;
        render: FunctionRef | undefined;
        setLocation(location: string): void;
        toObject(): PanelData | undefined;
    }
    Index
    • Removes the panel from the UI.

      Returns void

    • Moves the panel to the other side of the viewer. Values other than 'left' and 'right' are ignored with a warning.

      Parameters

      • location: string

        'left' or 'right'.

      Returns void

    • Returns the panel's data.

      Returns PanelData | undefined

      A copy of the stored panel data, or undefined when the panel no longer exists.

    dataElement: string

    Unique name of the panel; assigning a new name renames the panel.

    location: string | undefined

    Side of the viewer the panel opens on: 'left' or 'right'.

    render: FunctionRef | undefined

    Built-in panel name, or a function that returns the panel content.