TagoIO SDK for JavaScript and TypeScript
    Preparing search index...

    Interface PDFParams

    interface PDFParams {
        base64?: string;
        fileName?: string;
        html?: string;
        options?: {
            displayHeaderFooter?: boolean;
            footerTemplate?: string;
            format?: string;
            headerTemplate?: string;
            height?: string | number;
            landscape?: boolean;
            margin?: {
                bottom?: string | number;
                left?: string | number;
                right?: string | number;
                top?: string | number;
            };
            pageRanges?: string;
            preferCSSPageSize?: boolean;
            printBackground?: boolean;
            scale?: number;
            width?: string
            | number;
        };
        url?: string;
    }
    Index

    Properties

    base64?: string

    HTML on base64 format

    fileName?: string

    File name of pdf Without filename, it will generate base64 response With filename it will generate pdf binary

    html?: string

    HTML as string

    options?: {
        displayHeaderFooter?: boolean;
        footerTemplate?: string;
        format?: string;
        headerTemplate?: string;
        height?: string | number;
        landscape?: boolean;
        margin?: {
            bottom?: string | number;
            left?: string | number;
            right?: string | number;
            top?: string | number;
        };
        pageRanges?: string;
        preferCSSPageSize?: boolean;
        printBackground?: boolean;
        scale?: number;
        width?: string
        | number;
    }

    PDF Custom Options

    Type declaration

    • OptionaldisplayHeaderFooter?: boolean

      Display header and footer. Defaults to false.

    • OptionalfooterTemplate?: string

      HTML template for the print footer. Should use the same format as the headerTemplate.

    • Optionalformat?: string

      Paper format. If set, takes priority over width or height options. Defaults to 'Letter'.

    • OptionalheaderTemplate?: string

      HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:

      • 'date' formatted print date
      • 'title' document title
      • 'url' document location
      • 'pageNumber' current page number
      • 'totalPages' total pages in the document
    • Optionalheight?: string | number

      Paper height, accepts values labeled with units.

    • Optionallandscape?: boolean

      Paper orientation. Defaults to false.

    • Optionalmargin?: {
          bottom?: string | number;
          left?: string | number;
          right?: string | number;
          top?: string | number;
      }

      Paper margins, defaults to none.

      • Optionalbottom?: string | number

        Bottom margin, accepts values labeled with units. Defaults to 0.

      • Optionalleft?: string | number

        Left margin, accepts values labeled with units. Defaults to 0.

      • Optionalright?: string | number

        Right margin, accepts values labeled with units. Defaults to 0.

      • Optionaltop?: string | number

        Top margin, accepts values labeled with units. Defaults to 0.

    • OptionalpageRanges?: string

      Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.

    • OptionalpreferCSSPageSize?: boolean

      Give any CSS @page size declared in the page priority over what is declared in width and height or format options. Defaults to false, which will scale the content to fit the paper size.

    • OptionalprintBackground?: boolean

      Print background graphics. Defaults to false.

    • Optionalscale?: number

      Scale of the webpage rendering. Defaults to 1. Scale amount must be between 0.1 and 2.

    • Optionalwidth?: string | number

      Paper width, accepts values labeled with units.

    url?: string

    Generate pdf from URL