@qrcommunication/gigapdf-lib — SDK API reference - v0.110.3
    Preparing search index...

    Type Alias HFItem

    HFItem:
        | {
            type: "text";
            anchor?: HFAlign;
            dx?: number;
            dy?: number;
            text: string;
            fontRef?: number
            | null;
            size?: number;
            color?: [number, number, number];
            bold?: boolean;
            italic?: boolean;
        }
        | {
            type: "image";
            anchor?: HFAlign;
            dx?: number;
            dy?: number;
            w: number;
            h: number;
            imageId: number;
            opacity?: number;
        }

    One drawable element of a rich running header/footer band: a line of text or a raster image (a discriminated union on type). Anchored within the printable width by anchor, then nudged (dx, dy) points in PDF axes (+dx → right, +dy → up).

    Type Declaration

    • {
          type: "text";
          anchor?: HFAlign;
          dx?: number;
          dy?: number;
          text: string;
          fontRef?: number | null;
          size?: number;
          color?: [number, number, number];
          bold?: boolean;
          italic?: boolean;
      }
      • type: "text"
      • Optionalanchor?: HFAlign

        Horizontal anchor (default "left").

      • Optionaldx?: number

        Horizontal nudge, points (default 0).

      • Optionaldy?: number

        Vertical nudge, points (default 0).

      • text: string

        Template text — may contain {{page}}, {{pages}}, {{date}} and {{title}}, substituted at bake time.

      • OptionalfontRef?: number | null

        An embedded-font object id (from GigaPdfDoc.embedFont); omit/null to use the engine's bundled OFL face (a real embedded font, never base-14).

      • Optionalsize?: number

        Font size, points (default 10).

      • Optionalcolor?: [number, number, number]

        RGB fill colour, 0..255 per channel (default black [0,0,0]).

      • Optionalbold?: boolean

        Bold hint (carried with the def; honoured only by a bold fontRef).

      • Optionalitalic?: boolean

        Italic hint (carried with the def; honoured only by an italic fontRef).

    • {
          type: "image";
          anchor?: HFAlign;
          dx?: number;
          dy?: number;
          w: number;
          h: number;
          imageId: number;
          opacity?: number;
      }
      • type: "image"
      • Optionalanchor?: HFAlign

        Horizontal anchor (default "left").

      • Optionaldx?: number

        Horizontal nudge, points (default 0).

      • Optionaldy?: number

        Vertical nudge, points (default 0).

      • w: number

        Drawn width, points.

      • h: number

        Drawn height, points.

      • imageId: number

        Key into the images map passed to GigaPdfDoc.setRunningHeaderFooter.

      • Optionalopacity?: number

        Fill opacity 0..1 (default 1).