View as Markdown
PolyDoc icon

PolyDoc ACTION

Convert to PDF

Convert a URL, inline HTML, or a saved template to a PDF. See the documentation.
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's PolyDoc account once, then configure and run Convert 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: "polydoc-convert-pdf",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    polydoc: { authProvisionId: "apn_xxxxxxx" },
    sourceType: "Source Type",
    url: "URL",
  },
})

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.

Convert to PDF inputs
Property Type Description
sourceType Source Type string
Where the content to render comes from.
Required
url URL string
The web page to render. Used when Source Type is url.
Optional
html HTML string
Inline HTML to render. Used when Source Type is html.
Optional
templateId Template ID string
ID of a template saved in PolyDoc (for example jlE-whg). Used when Source Type is template.
Optional
templateData Template Data object
Key-value data passed to the Liquid template renderer. Example: { "customerName": "Ada Lovelace", "invoiceNumber": "INV-1001" }. Used when Source Type is template.
Optional
format Page Format string
Paper format for the PDF.
Optional
landscape Landscape boolean
Render in landscape orientation.
Optional
printBackground Print Background boolean
Include background graphics.
Optional
pageRanges Page Ranges string
Pages to include, for example 1-5, 8, 11-13.
Optional
outline Outline boolean
Generate PDF bookmarks from HTML headings.
Optional
tagged Tagged PDF boolean
Produce an accessible (tagged) PDF.
Optional
scale Scale string
Render scale between 0.1 and 2 (for example 0.8).
Optional
marginTop Margin Top string
Top margin, for example 10mm.
Optional
marginRight Margin Right string
Right margin, for example 10mm.
Optional
marginBottom Margin Bottom string
Bottom margin, for example 10mm.
Optional
marginLeft Margin Left string
Left margin, for example 10mm.
Optional
filename Filename string
Output filename, used in the file written for download delivery.
Optional
tag Tag string
A short label (max 30 chars) for logging and analytics.
Optional
timeout Timeout (ms) integer
Conversion timeout in milliseconds. The free tier is capped at 30000.
Optional
deliveryMode Delivery Mode string
How the result is delivered.
Required
presignedUrl Presigned URL string
A presigned upload URL (S3 / GCS / Azure). Used when Delivery Mode is cloudStorage.
Optional
webhookUrl Webhook URL string
The URL the file is delivered to. Used when Delivery Mode is webhook.
Optional
webhookOptions Webhook Options object
Optional webhook settings. Example: { "async": true, "method": "POST", "headers": { "X-Signature": "abc123" }, "retries": 3, "retryDelay": 1000, "timeout": 10000 }.
Optional
advanced Advanced (JSON) object
Raw object deep-merged into the request body for any API field not exposed above (for example pdf.watermark, pdf.pdfa, render, request). Advanced values win on conflict.
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
polydoc-convert-pdf
Version
0.0.2
App
PolyDoc
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes