PDFCrowd ACTION
Convert HTML to PDF
Convert URL or HTML to PDF. See docs
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's PDFCrowd account once, then configure and run Convert HTML to 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: "pdfcrowd-html-to-pdf",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
pdfcrowd: { authProvisionId: "apn_xxxxxxx" },
url: "URL",
htmlString: "HTML Content",
},
})
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": "pdfcrowd-html-to-pdf",
"configured_props": {
"pdfcrowd": { "authProvisionId": "apn_xxxxxxx" },
"url": "URL",
"htmlString": "HTML Content"
}
}'// 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": "pdfcrowd",
},
},
},
)
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: "pdfcrowd-html-to-pdf",
arguments: {
url: "URL",
htmlString: "HTML Content",
},
})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 to convert. Must be publicly accessible. Optional |
htmlString HTML Content | string | Raw HTML content to convert to PDF. Optional |
outputFilename Output Filename | string | The filename for the generated PDF. Optional |
pageSize Page Size | string | Set the output page size using standard formats (A4, Letter, A3, etc.).... Optional |
pageWidth Page Width | string | Set custom page dimensions when standard sizes don't fit your needs.... Optional |
pageHeight Page Height | string | Set custom page height for specific formats like receipts, banners, or... Optional |
orientation Orientation | string | Set the output page orientation to portrait or landscape. Use landscape... Optional |
marginTop Margin Top | string | Control white space at the top of the page. Increase for header space,... Optional |
marginRight Margin Right | string | Control white space on the right edge of the page. Increase for... Optional |
marginBottom Margin Bottom | string | Control white space at the bottom of the page. Increase for footer... Optional |
marginLeft Margin Left | string | Control white space on the left edge of the page. Increase for... Optional |
contentViewportWidth Content Viewport Width | string | Set the viewport width for formatting the HTML content when generating... Optional |
customCss Custom CSS | string | Apply custom CSS to the input HTML document to modify the visual... Optional |
customJavascript Custom JavaScript | string | Run a custom JavaScript after the document is loaded and ready to... Optional |
elementToConvert Element To Convert | string | Convert only the specified element from the main document and its... Optional |
showExpertOptions Show Expert Options | boolean | Enable to show advanced conversion options 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
- pdfcrowd-html-to-pdf
- Version
- 0.1.0
- App
- PDFCrowd
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗