Gaffa
  • Introduction
  • Get Started
  • Credits and Pricing
  • Changelog
  • Features
    • Browser Requests
      • Actions
        • Capture DOM
        • Capture Screenshot
        • Capture Snapshot
        • Click
        • Generate Markdown
        • Generate Simplified DOM
        • Print
        • Scroll
        • Type
        • Wait
      • API Playground Examples
        • Export Web Page to PDF
        • Convert Web Page to Markdown
        • Infinitely Scroll an Ecommerce Site
        • Capture a Full Height Screenshot
        • Automated Form Filling
  • API Reference
    • API Authentication
    • POST v1/browser/request
    • GET v1/browser/request/{id}
    • GET v1/browser/requests
Powered by GitBook
On this page
  • Parameters
  • Usage
  • Example Output
Export as PDF
  1. Features
  2. Browser Requests
  3. Actions

Print

PreviousGenerate Simplified DOMNextScroll

Last updated 5 months ago

Type: print

Request that the browser prints the page to a PDF.

Parameters

Name
Type
Required
Description

size

string

The size of paper the page should be printed to. Default: A4 Accepted: ["A4"]

margin

integer

The margin of the page in pixels when the page is printed to PDF. Default: 20

orientation

string

Should execution of further actions continue or throw an error if this action fails. Default: portrait Accepted: ["portrait", "landscape"]

continue_on_fail

boolean

Should execution of further actions continue or throw an error if this action fails. Default: true

See .

Usage

Print a page in landscape to PDF

The following JSON prints the page to a PDF in landscape with margins of 20px.

"actions": [
    {
        "type": "print",
        "page_size": "A4",
        "orientation": "landscape",
        "margin": 20
    }
]

Example Output

universal parameters
51KB
GaffaPrintPdfExample.pdf
pdf