Pipedream
PolyDoc has a native Pipedream app: connect your PolyDoc account once, then drop a PolyDoc action into any workflow to convert HTML or URLs to PDF, capture screenshots, and generate EU e-invoices. No code step, no manual axios call, no key pasted into the workflow.
Prerequisites
- A PolyDoc account and API key - sign up for free, no credit card required. The free plan includes 150 PDF conversions per month.
- A Pipedream account - sign up for free with generous free-tier limits. The triggers used in these use cases (HTTP, Schedule) run on the free plan.
Connect your PolyDoc account
PolyDoc auth lives on a connected account, so you enter your key once and every PolyDoc action reuses it. The first time you add a PolyDoc action to a workflow, Pipedream prompts you to connect an account. You can also set it up ahead of time under Settings → Accounts → Connect an app → PolyDoc. The connect form asks for a single field:
- API Key: a key from the Dashboard (open the Account menu, then API Keys). Pipedream stores it encrypted and never exposes it in the workflow definition. Optionally name the connection (for example
PolyDoc production) so you can tell multiple keys apart.
Use Case 1: Invoice PDF from a saved template
Render a template you saved in PolyDoc to a branded PDF, filling it with data from an upstream step (a form submission, a Google Sheets row, a database query). One action, no code.Trigger → PolyDoc (Convert to PDF) → deliver the file
Add a trigger
In Pipedream click New → Workflow, pick a project, and choose HTTP / Webhook as the trigger - the quickest way to feed test data in. (Schedule, Google Sheets (New Row), and other app triggers work too; swap the trigger later without touching the PolyDoc step.) In the trigger panel click Generate Test Event, set the request Body to your invoice fields, and Send:
{ "invoice_number": "INV-001", "customer_name": "Customer SARL" }
Pipedream captures the event and selects it automatically, so the downstream step can reference steps.trigger.event.body. (Prefer your own tools? curl -X POST the endpoint URL instead, then pick the request under Select Event.)
Add the Convert to PDF action
Click the + below the trigger, search for PolyDoc, and choose Convert to PDF. Pick your connected PolyDoc account, then set:
- Source Type: Template (render a saved PolyDoc template by ID)
- Template ID: your template's short ID from the Dashboard (see Templates), for example
jlE-whg - Template Data: the data your template renders. Map values from the trigger with
{{steps.trigger.event.body.<field>}}:
{
"invoice_number": "INV-001",
"invoice_date": "2026-01-31",
"customer_name": "Customer SARL",
"items": [
{ "name": "Widget", "description": "Blue widget", "quantity": 2, "price": 10 }
]
}
The PDF layout options (Page Format, Landscape, Print Background, margins, Page Ranges, accessible Tagged PDF) default to A4 portrait with backgrounds on; adjust as needed. Set a Filename like invoice.pdf and leave Delivery Mode on Download.
Use the PDF downstream
Run the step. On success the action writes the file for the workflow and returns:
{
"path": "/tmp/invoice.pdf",
"filename": "invoice.pdf",
"contentType": "application/pdf",
"sizeBytes": 51234
}
Add any downstream step and point it at {{steps.polydoc_convert_to_pdf.$return_value.path}} - Gmail or SendGrid to email the PDF, Google Drive / S3 to archive it, Slack to post it. The file rides along with the workflow run, so no extra upload step is needed.
Use Case 2: Scheduled website screenshot
Capture a PNG of any web page on a schedule - useful for visual monitoring, social / OG images, and change tracking.Schedule → PolyDoc (Capture Screenshot) → deliver the image
Add the Schedule trigger
Create a new workflow and choose Schedule as the trigger. Set the cadence you want - every 24 hours for a daily snapshot, or a custom cron expression. Pipedream fires the workflow on that schedule with no input event needed.
Configure Capture Screenshot
Add a PolyDoc action and pick Capture Screenshot. Select your connected account, then set:
- Source Type: URL (render a web page)
- URL:
https://example.com - Image Type: PNG, JPEG, or WebP
- Full Page: on to capture the whole scrollable page
- Viewport Width / Height (default 1280 x 800) and Device Pixel Ratio (e.g. 2 for retina) control the capture size
Leave Delivery Mode on Download and set a Filename. On a schedule a static name overwrites the last capture, so bind the per-event ID for a unique name each run: snapshot-{{steps.trigger.context.id}}.png. Any {{ ... }} expression works here - use a date field from the trigger event if you prefer a readable name.
Deliver or archive the image
Run the step. The PNG is written for the workflow and the action returns { path, filename, sizeBytes, contentType }. Add a downstream step - Slack, Google Drive, S3, email - and bind {{steps.polydoc_capture_screenshot.$return_value.path}} to deliver or archive it. Click Deploy to run it unattended on the schedule.
Use Case 3: E-invoice from a webhook
Accept invoice JSON over HTTP and return a ZUGFeRD / Factur-X hybrid PDF/A-3 e-invoice: a PDF that carries machine-readable EN 16931 XML inside it.HTTP / Webhook → PolyDoc (Generate E-Invoice) → Return HTTP Response
Receive the invoice payload
Create a workflow with an HTTP / Webhook trigger and switch HTTP Response to Return a custom response from your workflow so the code can hand the PDF back inline. Click Generate Test Event, set the request Body to a sample invoice, and Send so Pipedream learns the field shape:
{ "number": "INV-PD-001" }
Pipedream captures and selects the event automatically. (Or copy the endpoint URL and curl -X POST it, then pick the request under Select Event.)
Configure Generate E-Invoice
Add a PolyDoc action and pick Generate E-Invoice. Select your connected account, then set:
- Source Type: HTML (the human-readable page), for example
<h1>Invoice {{steps.trigger.event.body.number}}</h1>, or a Template for a branded layout - Standard: ZUGFeRD (Germany / EU) or Factur-X (France / EU)
- Profile:
en16931(the EU-standard profile;minimumthroughextendedare also available) - Verify: on - fails the action if the result is not a valid PDF/A-3 e-invoice
- Invoice: the structured EN 16931 object that becomes the embedded XML. Bind it to the trigger, or write a minimum valid payload:
{
"number": "INV-PD-001",
"issueDate": "2026-01-15",
"dueDate": "2026-02-15",
"currencyCode": "EUR",
"seller": {
"name": "Northwind Studio",
"address": { "line1": "1 Studio Way", "city": "Berlin", "postalCode": "10115", "countryCode": "DE" },
"taxId": "DE123456789"
},
"buyer": {
"name": "Contoso GmbH",
"address": { "line1": "5 Market St", "city": "Munich", "postalCode": "80331", "countryCode": "DE" }
},
"lines": [
{ "description": "Design services", "quantity": 10, "unitPrice": 100, "lineTotal": 1000, "vatRate": 19, "vatCategoryCode": "S" }
],
"taxSummary": [
{ "categoryCode": "S", "rate": 19, "taxableAmount": 1000, "taxAmount": 190 }
],
"paymentTerms": "Net 30 days",
"totalNetAmount": 1000,
"totalTaxAmount": 190,
"totalGrossAmount": 1190
}
Leave Delivery Mode on Download.
Run and return the e-invoice
Click Test. The action generates the hybrid PDF/A-3, verifies it, and returns the file:
{
"path": "/tmp/document.pdf",
"filename": "document.pdf",
"contentType": "application/pdf",
"sizeBytes": 15790
}
The trigger is set to Return a custom response, so hand the PDF straight back to the caller: add a Return HTTP Response step that reads the file and sets the headers.
import fs from "fs";
export default defineComponent({
async run({ steps, $ }) {
const { path, filename } = steps.polydoc_generate_e_invoice.$return_value;
await $.respond({
status: 200,
headers: {
"Content-Type": "application/pdf",
"Content-Disposition": `attachment; filename="${filename}"`,
},
body: fs.readFileSync(path),
});
},
});
Click Deploy. Any service that POSTs invoice JSON to the endpoint now receives the compliant e-invoice PDF inline. Prefer not to return it synchronously? Swap the response step for an email, storage, or webhook delivery instead.
Actions and options (reference)
One PolyDoc app, four actions. Each action shares the same source and delivery controls, plus its own operation-specific fields.
| Action | What it does |
|---|---|
| Convert to PDF | Render a URL, inline HTML, or a saved template to a PDF. |
| Capture Screenshot | Capture a PNG, JPEG, or WebP of a URL, HTML, or template. |
| Generate E-Invoice | Produce a ZUGFeRD / Factur-X hybrid PDF/A-3 e-invoice (EN 16931). |
| Test Connection | Validate the connected API key with a tiny sandbox render. |
| Control | Options |
|---|---|
| Source Type | URL (render a web page), HTML (inline string), Template (a saved PolyDoc template by ID). |
| Delivery Mode | Download (file written for the workflow), Cloud Storage (PUT to your presigned URL), Webhook (deliver the file to a URL). |
| Advanced (JSON) | An object deep-merged into the request body for any API field not surfaced as a control (watermarks, PDF/A, PDF/UA, custom render and request options). Advanced values win on conflict. |
A Download action writes the file for the workflow and returns { path, filename, sizeBytes, contentType }; downstream steps read steps.<key>.$return_value.path. The full field list per operation is in the API reference.
Prefer code?
The native actions cover the common jobs. When you need full control - a shape the action does not expose, or a step that composes several calls - call the PolyDoc API directly from a Node.js code step. Pipedream ships axios in the @pipedream/platform runtime:
import { axios } from "@pipedream/platform";
export default defineComponent({
async run({ steps, $ }) {
const pdf = await axios($, {
method: "POST",
url: "https://api.polydoc.tech/pdf/convert",
headers: {
Authorization: `Bearer ${process.env.POLYDOC_API_KEY}`,
"Content-Type": "application/json",
"X-Sandbox": "true",
},
data: {
source: "[template:YOUR_TEMPLATE_ID]",
templateData: steps.trigger.event.body,
},
responseType: "arraybuffer",
});
$.export("pdf_base64", Buffer.from(pdf).toString("base64"));
},
});
Templates
Three starter recipes, one per angle above, are documented in the connector repo. Each lists the trigger, the PolyDoc action, and the props to set:
- Invoice PDF from template data - Convert to PDF with a saved template.
- Scheduled URL screenshot - Capture Screenshot of a URL on a schedule.
- E-invoice from a webhook - Generate E-Invoice from posted invoice JSON.
Next steps
- New to PolyDoc? Create a free account - 150 conversions per month, no credit card.
- Compare options: see how PolyDoc compares to other HTML-to-PDF APIs.
- EU e-invoicing: PolyDoc also generates Factur-X and ZUGFeRD e-invoices from JSON.