View as Markdown
HTML 2 PDF icon

HTML 2 PDF ACTION

Generate PDF

Creates a PDF from a URL or HTML string. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's HTML 2 PDF account once, then configure and run Generate 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: "html_2_pdf-generate-pdf",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    html_2_pdf: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    html: "HTML",
  },
})

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.

Generate PDF inputs
Property Type Description
url URL string
The URL you want to convert to PDF.
Optional
html HTML string
The HTML you want to convert to PDF.
Optional
header Header string
Header in HTML format.
Optional
footer Footer string
Footer in HTML format.
Optional
pageOffset Page Offset integer
Number to offset your page number
Optional
pageSize Page Size string
The standard page formats.
Optional
orientation Orientation string
The page orientation.
Optional
width Width string
Custom width (overrides 'Page Size').
Optional
height Height string
Custom height (overrides 'Page Size').
Optional
top Top Margin string
You need one if you want to display a header.
Optional
bottom Bottom Margin string
You need one if you want to display a footer.
Optional
left Left string
Left margin.
Optional
right Right string
Right margin.
Optional
unit Unit string
Unit for the custom width, height and margins.
Optional
cssMediaType CSS Media Type string
The layout CSS media type.
Optional
optimizeLayout Optimize Layout boolean
Set this to true if you want us to auto-optimize your layout. This helps static items on your page to only show up once, instead of on every page.
Optional
lazyLoad Lazy Load boolean
Set this to true if you want our software to wait for content to lazy load.
Optional
waitTime Wait Time integer
Time in milliseconds that you want our software to wait after the page is loaded. You typically use this when you have long running JavaScript for graphs and tables.
Optional
css CSS string
Use custom CSS to overwrite the default styles of your page.
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
html_2_pdf-generate-pdf
Version
0.0.3
App
HTML 2 PDF
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes