Generate PDFs from Google Sheets
To generate a PDF from Google Sheets, make an HTTP request (from Apps Script, Google Workflows, or an automation tool connected to your sheet) that POSTs a row's data to the Docweave API at /api/v1/pdf, which renders it into a PDF and returns it in the response.
Google Sheets has no native "export row as PDF" API call, so every no-code path — Apps Script, Zapier, Make, n8n — ultimately comes down to the same thing: read the row, send it as JSON in an HTTP request, get a PDF back. Docweave is built for exactly that request.
Wire the automation, step by step
- Trigger: start from a Google Sheets trigger — an on-edit/on-form-submit trigger in Apps Script, or a "New or Updated Spreadsheet Row" trigger if you're using Zapier, Make, or n8n's Google Sheets module.
- Read the row: pull the column values you need (for example order ID, customer name, total) into variables or module fields.
- HTTP request step: add an "HTTP Request" / "Webhooks" module (or, in Apps Script, call
UrlFetchApp.fetch()) configured as:- Method:
POST - URL:
https://docweave.dev/api/v1/pdf - Headers:
Authorization: Bearer dw_live_your_keyandContent-Type: application/json - Body type: JSON / raw
- Method:
- Body: map each column value into the
dataobject of the JSON body (see example below), matching the{{ placeholders }}in your HTML template. - Save the result: the response body is the generated PDF. Store it back to Google Drive (via the module's file-creation step), email it, or forward it to whatever step comes next in your automation.
Example request from your automation
Column values from the sheet fill the data object; the placeholders in your HTTP step map row fields (such as {{Order ID}}) into this same shape:
curl https://docweave.dev/api/v1/pdf \
-H "Authorization: Bearer dw_live_your_key" \
-H "Content-Type: application/json" \
-H "Accept: application/pdf" \
--output order-{{Row ID}}.pdf \
-d '{
"source": {
"type": "template",
"template": "<h1>Order {{ order_id }}</h1><p>Customer: {{ customer }}</p><p>Total: {{ total }}</p>",
"data": {
"order_id": "{{Order ID}}",
"customer": "{{Customer Name}}",
"total": "{{Total}}"
}
},
"options": { "format": "A4" },
"idempotencyKey": "{{Row ID}}"
}'Copyable JSON body
Drop this into the body field of your HTTP request step and swap in your own template and column mappings:
{
"source": {
"type": "template",
"template": "<h1>Order {{ order_id }}</h1><p>Customer: {{ customer }}</p><p>Total: {{ total }}</p>",
"data": {
"order_id": "1042",
"customer": "Acme Inc.",
"total": "$480.00"
}
},
"options": { "format": "A4" },
"idempotencyKey": "sheet-row-1042"
}No-code and MCP options
If you'd rather not hand-build the HTTP step, connect Sheets to Docweave through your automation platform's generic HTTP/webhook module (Zapier, Make, and n8n all support one) — the request shape above stays the same regardless of platform. Building an AI workflow instead of a spreadsheet automation? The open-source @docweave/mcp server (run with npx @docweave/mcp) gives an agent a generate_pdf tool that wraps the same API, so it can turn sheet data into a PDF without writing raw HTTP calls at all.
Other spreadsheet-to-PDF tools exist as Google Workspace add-ons or Apps Script libraries; check the provider's current docs/pricing to compare against a plain HTTP call to Docweave.
FAQ
How do I generate a PDF from Google Sheets?
Add an HTTP request step to your Google Sheets automation (Apps Script, Google Workflows, or a tool like Zapier/Make/n8n connected to Sheets) that POSTs to https://docweave.dev/api/v1/pdf with an Authorization: Bearer header and a JSON body containing a template plus the row data. Docweave renders the PDF and returns it in the response.
Can Google Sheets call an external API directly?
Yes, via Apps Script's UrlFetchApp.fetch() bound to the sheet, a time-driven or on-edit trigger, or an automation platform (Zapier, Make, n8n) that watches the sheet and makes the HTTP call for you. All of these can send a standard POST request with headers and a JSON body.
How do I map spreadsheet columns into the PDF?
Read the row values (by column name or index) and place them into the "data" object of the request body, keyed to match the {{ placeholders }} in your HTML template. Each column becomes one field Docweave binds into the rendered PDF.
How do I avoid generating a duplicate PDF if a row is processed twice?
Pass an idempotencyKey built from a stable row identifier (a row ID or unique order number). A repeat request with the same key returns the previously generated PDF instead of rendering — and billing — again.
Ready to generate PDFs from Google Sheets in production?
Get an API key