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)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "html_2_pdf-generate-pdf",
"configured_props": {
"html_2_pdf": { "authProvisionId": "apn_xxxxxxx" },
"url": "URL",
"html": "HTML"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "html_2_pdf",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "html_2_pdf-generate-pdf",
arguments: {
url: "URL",
html: "HTML",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| 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
- Source
- View on GitHub ↗