PDF Service API Documentation

Endpoints

/render

headers:

  • x-api-token required: the api token used to authenticate the request

    Contact carlos.perez@mwcradio.com to obtain an API token.

  • x-api-user: the user (typically the hostname or RadioCMS site name) for the request

methods:

  • GET
    Required parameters:
    • url

      URL to render as a PDF

  • POST
    Required body:
    • {"html": "<content>"}

      JSON object with html key set to HTML content to be rendered as PDF

Options

Options are specified as querystring parameters and passed to the puppeteer-pdf package .

See Puppeteer docs for additional information.

scale

Kind: float

Scale of the webpage rendering.

displayHeaderFooter

Kind: flag

Display header and footer.

printBackground

Kind: flag

Print background graphics.

landscape

Kind: flag

Paper orientation

pageRanges

Kind: string

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

format

Kind: string

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

width

Kind: string

Paper width, accepts values labeled with units.

height

Kind: string

Paper height, accepts values labeled with units.

marginTop

Kind: string

Top margin, accepts values labeled with units.

marginRight

Kind: string

Right margin, accepts values labeled with units.

marginBottom

Kind: string

Bottom margin, accepts values labeled with units.

marginLeft

Kind: string

Left margin, accepts values labeled with units.

waitUntil

Kind: string

waitUntil accepts choices load, domcontentloaded, networkidle0, networkidle2. Defaults to 'networkidle2'.

font-families

methods:

  • GET
    Returns a JSON object with available font families:
    {"font-families": ["<family-a>", ... "<family-n>"]}