Creating PDFs

This guide will show you how to create PDFs using the ScreenshotBuddy API.

Options

  • Name
    url
    Type
    string
    Description

    The URL of the website you want to create a PDF of.

  • Name
    pdf
    Type
    boolean
    Description

    Must be set to true to generate a PDF instead of a screenshot.

  • Name
    format
    Type
    string
    Description

    The paper format. Possible values are letter, legal, tabloid, ledger, a0 through a6. Defaults to a4.

  • Name
    landscape
    Type
    boolean
    Description

    Whether to use landscape orientation. Defaults to false (portrait).

  • Name
    width
    Type
    number
    Description

    Custom paper width. Must be used together with height. Overrides format when set. Unit is determined by marginUnit (defaults to mm).

  • Name
    height
    Type
    number
    Description

    Custom paper height. Must be used together with width. Overrides format when set. Unit is determined by marginUnit (defaults to mm).

  • Name
    marginTop
    Type
    number
    Description

    Top margin. All four margins (marginTop, marginRight, marginBottom, marginLeft) must be set together.

  • Name
    marginRight
    Type
    number
    Description

    Right margin.

  • Name
    marginBottom
    Type
    number
    Description

    Bottom margin.

  • Name
    marginLeft
    Type
    number
    Description

    Left margin.

  • Name
    marginUnit
    Type
    string
    Description

    The unit for margins and custom paper size. Possible values are mm, cm, in, px. Defaults to mm.

  • Name
    scale
    Type
    number
    Description

    The scale of the webpage rendering. A value between 0.1 and 2. Defaults to 1.