escpos-ts API - v1.0.0
    Preparing search index...

    Interface PrinterProfile

    Runtime interface for a resolved printer profile.

    Wraps ProfileData with computed helper methods used throughout the Escpos base class for column-width negotiation, font selection, and code-page management.

    Obtain an instance via ProfileManager.getProfile.

    import { ProfileManager } from 'escpos-ts';

    const profile = ProfileManager.getProfile('TM-T88V');
    console.log(profile.getColumns('a')); // 42
    console.log(profile.supports('paperFullCut')); // true

    1.0.0

    interface PrinterProfile {
        profileData: ProfileData;
        getCodePages(): Record<string, number>;
        getColumns(font: "a" | "b"): number;
        getFont(font: string | number): number;
        supports(feature: string): boolean;
    }
    Index

    Properties

    profileData: ProfileData

    The raw profile data object loaded from capabilities.json.

    Methods

    • Return the inverted code-page map for this profile.

      The returned object maps encoding names to their ESC/POS index, which is the opposite of the raw profileData.codePages map (index → name).

      Returns Record<string, number>

      Record<name, index>, e.g. { "CP437": 0, "CP850": 2 }.

    • Resolve a font name or index to a validated numeric font index.

      Parameters

      • font: string | number

        Font identifier: "a", "b", or a numeric index.

      Returns number

      Numeric font index (0 = Font A, 1 = Font B).

      Error if the font is not defined in the current profile.

    • Return whether the profile declares support for a named feature.

      Parameters

      • feature: string

        Feature key as it appears in profileData.features, e.g. "paperFullCut", "paperPartCut", "cashDrawer".

      Returns boolean

      true if the feature flag is explicitly set to true.