View as Markdown
Puppeteer icon

Puppeteer ACTION

Get PDF

Generate a PDF of a page using Puppeteer. See the documentation
  • Action
  • Read only
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Puppeteer account once, then configure and run Get PDF from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "puppeteer-get-pdf",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    puppeteer: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    downloadPath: "Download Path",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Get PDF inputs
Property Type Description
url URL string
The URL of the page to scrape. For example, https://example.com.
Required
downloadPath Download Path string
Download the PDF to the /tmp directory with the specified filename
Optional
displayHeaderFooter Display Header Footer boolean
Whether to show the header and footer.
Optional
footerTemplate Footer Template string
HTML template for the print footer.
Optional
format Format string
The paper format of the PDF
Optional
headerTemplate Header Template string
HTML template for the print header. Should be valid HTML with the following classes used to inject values into them: date - formatted print date, title - document title, url - document location, pageNumber - current page number, totalPages - total pages in the document.
Optional
height Height string
Sets the height of paper. You can pass in a number or a string with a unit.
Optional
landscape Landscape boolean
Whether to print in landscape orientation.
Optional
marginBottom Bottom Margin string
Margin for the bottom of the page
Optional
marginLeft Left Margin string
Margin for the left side of the page
Optional
marginRight Right Margin string
Margin for the right side of the page
Optional
marginTop Top Margin string
Margin for the top of the page
Optional
omitBackground Omit Background boolean
Hides default white background and allows generating pdfs with transparency.
Optional
pageRanges Page Ranges string
Paper ranges to print, e.g. 1-5, 8, 11-13.
Optional
preferCSSPageSize Prefer CSS Page Size boolean
Give any CSS @page size declared in the page priority over what is declared in the width or height or format option.
Optional
printBackground Print Background boolean
Set to true to print background graphics.
Optional
scale Scale string
Scales the rendering of the web page. Amount must be between 0.1 and 2.
Optional
timeout Timeout integer
Timeout in milliseconds. Pass 0 to disable timeout.
Optional
width Width string
Sets the width of paper. You can pass in a number or a string with a unit.
Optional
syncDir SyncDir dir
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
puppeteer-get-pdf
Version
1.0.5
App
Puppeteer
Authentication
API key
Read-only
Yes
Destructive
No
Open world
Yes