Skip to main content
Convert HTML into professional-looking images using the html Page option. See Screenshot options for all available options for screenshots.

Example

This example generates a basic image that is 400x200.
curl --request POST 'https://api.doczilla.app/v1/screenshot' \
  --header 'Authorization: Bearer <your token>' \
  --header 'Content-Type: application/json' \
  --output 'doczilla.pdf' \
  --data '{
    "page": {
      "html": "PGRpdj5Zb3VyIGZpcnN0IERvY3ppbGxhIGltYWdlPC9kaXY+"
    },
    "screenshot": {
      "viewport": {
        "width": 400,
        "height": 200
      }
    }
  }'
import Doczilla from '@doczilla/node'

const doczilla = new Doczilla('<your token>')

const pdf = await doczilla.screenshot.direct({
  page: {
    html: '<div>Your first Doczilla image</div>'
  },
  screenshot: {
    viewport: {
      width: 400,
      height: 200
    }
  }
})

Output