ComPDFKit Web SDK
    Preparing search index...

    Interface FlyoutsAPI

    UI.Flyouts: adds, removes, finds and shows flyouts.

    interface FlyoutsAPI {
        addFlyouts(flyoutList: Flyout[]): void;
        getAllFlyouts(): Flyout[];
        getFlyout(dataElement: string): Flyout | null;
        removeFlyout(dataElement: string): void;
        setActiveFlyout(dataElement: string | null | undefined): void;
        setFlyoutPosition(position: { x: number; y: number }): void;
    }
    Index
    • Adds flyouts created with UI.Components.Flyout. Stops with a console error at the first invalid item (flyouts already added are kept); a duplicate name is made unique.

      Parameters

      • flyoutList: Flyout[]

        Flyout instances to add.

      Returns void

    • Returns every flyout of the viewer, including those of the default UI.

      Returns Flyout[]

      Flyout instances holding copies of the stored data.

    • Finds a flyout by name.

      Parameters

      • dataElement: string

        Name of the flyout.

      Returns Flyout | null

      A Flyout instance holding a copy of the stored data, or null when no flyout has this name.

    • Removes a flyout; if it is shown, it is closed.

      Parameters

      • dataElement: string

        Name of the flyout.

      Returns void

    • Shows a flyout, closing the one shown before. A flyout with a toggle button opens as that button's dropdown; others are drawn at the position set with setFlyoutPosition. Disabled flyouts do not open.

      Parameters

      • dataElement: string | null | undefined

        Name of the flyout; null or undefined closes the flyout shown.

      Returns void

    • Sets where a flyout without a toggle button is drawn; the flyout is kept 5 px inside the viewer.

      Parameters

      • position: { x: number; y: number }

        Top left corner in px, relative to the viewer's root element.

        • x: number

          Distance from the left edge of the viewer's root element, in px.

        • y: number

          Distance from the top edge of the viewer's root element, in px.

      Returns void