@cfxlabsinc/b2b-services
    Preparing search index...

    Class CloudflareBrowserRenderingClient

    Index
    • Renders bodyHtml wrapped in the CFX letterhead (header logo + footer + margins) and materializes the resulting stream into bytes. The single entry point for CFX-branded PDFs — callers never assemble the letterhead options themselves. Extra PDFOptions are layered between the default footer and the forced branding: a caller may override footerTemplate (e.g. a bank-specific disclaimer) but not the header/margins/format. Throws when the underlying render returns null (a Cloudflare-side error — renderPdfFromHtml returns null rather than throwing on a non-2xx response), so a failed render can never surface as an empty PDF.

      Parameters

      • __namedParameters: { bodyHtml: string; showLogo?: boolean } & {
            displayHeaderFooter?: boolean;
            footerTemplate?: string;
            format?:
                | "letter"
                | "legal"
                | "tabloid"
                | "ledger"
                | "a0"
                | "a1"
                | "a2"
                | "a3"
                | "a4"
                | "a5"
                | "a6";
            headerTemplate?: string;
            height?: string
            | number;
            landscape?: boolean;
            margin?: {
                bottom?: string | number;
                left?: string | number;
                right?: string | number;
                top?: string | number;
            };
            omitBackground?: boolean;
            outline?: boolean;
            pageRanges?: string;
            preferCSSPageSize?: boolean;
            printBackground?: boolean;
            scale?: number;
            tagged?: boolean;
            timeout?: number;
            width?: string
            | number;
        }
        • bodyHtml: string
        • OptionalshowLogo?: boolean
        • OptionaldisplayHeaderFooter?: boolean

          Whether to show the header and footer.

          false
          
        • OptionalfooterTemplate?: string

          HTML template for the print footer.

        • Optionalformat?:
              | "letter"
              | "legal"
              | "tabloid"
              | "ledger"
              | "a0"
              | "a1"
              | "a2"
              | "a3"
              | "a4"
              | "a5"
              | "a6"

          Paper format. Takes priority over width and height if set.

          letter
          @enum {string}
        • OptionalheaderTemplate?: string

          HTML template for the print header.

        • Optionalheight?: string | number

          Sets the height of paper. Can be a number or string with unit.

        • Optionallandscape?: boolean

          Whether to print in landscape orientation.

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

          Set the PDF margins. Useful when setting header and footer.

        • OptionalomitBackground?: boolean

          Hides default white background and allows generating pdfs with transparency.

          false
          
        • Optionaloutline?: boolean

          Generate document outline.

          false
          
        • OptionalpageRanges?: string

          Paper ranges to print, e.g. '1-5, 8, 11-13'.

        • OptionalpreferCSSPageSize?: boolean

          Give CSS

          size priority over other size declarations.

          false
          
        • OptionalprintBackground?: boolean

          Set to true to print background graphics.

          false
          
        • Optionalscale?: number

          Scales the rendering of the web page. Amount must be between 0.1 and 2.

          1
          
        • Optionaltagged?: boolean

          Generate tagged (accessible) PDF.

          true
          
        • Optionaltimeout?: number

          Timeout in milliseconds.

          30000
          
        • Optionalwidth?: string | number

          Sets the width of paper. Can be a number or string with unit.

      Returns Promise<Uint8Array<ArrayBuffer>>

    • Parameters

      • __namedParameters: {
            html: string;
            pdfOptions?: {
                displayHeaderFooter?: boolean;
                footerTemplate?: string;
                format?:
                    | "letter"
                    | "legal"
                    | "tabloid"
                    | "ledger"
                    | "a0"
                    | "a1"
                    | "a2"
                    | "a3"
                    | "a4"
                    | "a5"
                    | "a6";
                headerTemplate?: string;
                height?: string
                | number;
                landscape?: boolean;
                margin?: {
                    bottom?: string | number;
                    left?: string | number;
                    right?: string | number;
                    top?: string | number;
                };
                omitBackground?: boolean;
                outline?: boolean;
                pageRanges?: string;
                preferCSSPageSize?: boolean;
                printBackground?: boolean;
                scale?: number;
                tagged?: boolean;
                timeout?: number;
                width?: string
                | number;
            };
        }

      Returns Promise<ReadableStream<any> | null>