# Make integration

Call pdf-mcp from a [Make](https://make.com) scenario with an HTTP module. Make was formerly called Integromat. The same setup works for invoices, reports, certificates, and other HTML-based documents.

## What Make does

Make is a visual automation platform for connecting apps and services, with support for advanced workflow logic. A scenario can call pdf-mcp to:

- Generate PDFs when forms are submitted or webhooks trigger
- Create invoices automatically from e-commerce events
- Produce reports on schedules or data changes
- Convert HTML templates to PDFs in any scenario

---

## Before you start

1. A Make account (Free or paid plan)
2. A pdf-mcp account with an API key ([Get your API key](https://pdf-mcp.io/docs/quick-start))
3. Basic familiarity with Make scenarios

---

## Quick setup

### Step 1: Create a scenario

1. Log into [make.com](https://make.com) and click **Create a new scenario**
2. Add your trigger module (the event that starts the scenario)
3. Click the **+** button to add another module

### Step 2: Add an HTTP module

1. Search for **HTTP** in the module search
2. Select **HTTP** > **Make a request**
3. Click the module to configure it

### Step 3: Configure the request

Configure the HTTP module with these settings:

| Field | Value |
|-------|-------|
| URL | `https://api.pdf-mcp.io/htmlToPdf` |
| Method | `POST` |
| Headers | See configuration below |
| Body type | `Raw` |
| Content type | `JSON (application/json)` |

---

## HTTP module settings

### Basic settings

| Setting | Value |
|---------|-------|
| URL | `https://api.pdf-mcp.io/htmlToPdf` |
| Method | `POST` |
| Body type | `Raw` |
| Content type | `JSON (application/json)` |

### Headers

Add a header for authentication:

| Name | Value |
|------|-------|
| Authorization | `Bearer YOUR_API_KEY` |

Replace `YOUR_API_KEY` with your actual API key from the dashboard.

### JSON request body

```json
{
  "html": "<h1>Hello from Make!</h1><p>This PDF was generated automatically.</p>",
  "filename": "document.pdf"
}
```

### Response handling

Configure the response settings:

| Setting | Value |
|---------|-------|
| Parse response | `Yes` |

---

## Configure the HTTP module

### 1. Add the HTTP module

After your trigger module, click **+** and search for "HTTP":

1. Select **HTTP**
2. Choose **Make a request**
3. The configuration panel will open

### 2. Configure the URL and method

| Field | Value |
|-------|-------|
| URL | `https://api.pdf-mcp.io/htmlToPdf` |
| Method | `POST` |

### 3. Add headers

Click **Add a header** and configure:

| Name | Value |
|------|-------|
| Authorization | `Bearer YOUR_API_KEY` |

### 4. Configure the body

| Field | Value |
|-------|-------|
| Body type | `Raw` |
| Content type | `JSON (application/json)` |

### 5. Add the request content

In the **Request content** field, enter your JSON payload:

```json
{
  "html": "<h1>Hello from Make!</h1><p>Generated automatically.</p>",
  "filename": "document.pdf"
}
```

### 6. Configure response handling

Expand **Show advanced settings**:

| Setting | Value |
|---------|-------|
| Parse response | `Yes` (if you need JSON response) or `No` (for binary PDF) |

### 7. Test the module

Select **Run once**. A successful request puts the PDF data in the module output.

---

## Module settings to copy

Enter these settings in the Make HTTP module:

### HTML to PDF module

**URL:**
```
https://api.pdf-mcp.io/htmlToPdf
```

**Method:** `POST`

**Headers:**
```
Authorization: Bearer YOUR_API_KEY
```

**Body type:** `Raw`

**Content type:** `JSON (application/json)`

**Request content:**
```json
{
  "html": "<h1>Document Title</h1><p>Your content here.</p>",
  "css": "@page { size: A4; margin: 2cm; }",
  "filename": "document.pdf"
}
```

---

## Dynamic HTML with Make variables

Use Make's variable mapping to create dynamic PDFs from your trigger data.

### Variables in JSON

Make uses double curly braces `{{}}` for variable mapping. In the JSON editor:

```json
{
  "html": "<h1>Invoice #{{1.invoice_number}}</h1><p>Customer: {{1.customer_name}}</p><p>Amount: ${{1.amount}}</p>",
  "filename": "invoice-{{1.invoice_number}}.pdf"
}
```

The number before each field, such as `1.`, is the module's position in the scenario.

### Form response example

If your trigger is a webhook or form submission:

```json
{
  "html": "<!DOCTYPE html><html><head><title>Submission</title></head><body><h1>Form Submission</h1><p><strong>Name:</strong> {{1.name}}</p><p><strong>Email:</strong> {{1.email}}</p><p><strong>Message:</strong> {{1.message}}</p><p><em>Submitted: {{formatDate(now; \"MMMM D, YYYY\")}}</em></p></body></html>",
  "filename": "submission-{{1.submission_id}}.pdf"
}
```

### Invoice example

For e-commerce or payment triggers:

```json
{
  "html": "<!DOCTYPE html><html><head><title>Invoice</title></head><body><h1>Invoice #{{1.invoice_number}}</h1><p>Customer: {{1.customer_name}}</p><p>Email: {{1.customer_email}}</p><table style=\"width:100%; border-collapse:collapse;\"><tr style=\"background:#f0f0f0;\"><th style=\"border:1px solid #ddd; padding:8px;\">Description</th><th style=\"border:1px solid #ddd; padding:8px;\">Amount</th></tr><tr><td style=\"border:1px solid #ddd; padding:8px;\">{{1.product_name}}</td><td style=\"border:1px solid #ddd; padding:8px;\">${{1.amount}}</td></tr></table><p><strong>Total: ${{1.amount}}</strong></p></body></html>",
  "css": "@page { size: A4; margin: 2cm; } body { font-family: Arial, sans-serif; }",
  "filename": "invoice-{{1.invoice_number}}.pdf"
}
```

### Certificate example

For course completions or achievements:

```json
{
  "html": "<!DOCTYPE html><html><head><title>Certificate</title></head><body style=\"text-align:center; padding:50px;\"><h1 style=\"font-size:36px; color:#333;\">Certificate of Completion</h1><p style=\"font-size:24px; margin:30px 0;\">This is to certify that</p><p style=\"font-size:32px; font-weight:bold; color:#1a73e8;\">{{1.recipient_name}}</p><p style=\"font-size:24px; margin:30px 0;\">has successfully completed</p><p style=\"font-size:28px; font-weight:bold;\">{{1.course_name}}</p><p style=\"margin-top:50px;\">Date: {{formatDate(now; \"MMMM D, YYYY\")}}</p></body></html>",
  "css": "@page { size: landscape; margin: 2cm; }",
  "filename": "certificate-{{1.recipient_name}}.pdf"
}
```

---

## Scenario examples

### 1. Webhook to PDF

```
[Webhooks] → [HTTP: Generate PDF] → [Email: Send Attachment]
```

**Trigger:** Webhooks - Custom webhook receives data
**Action 1:** HTTP - Make a request to pdf-mcp
**Action 2:** Email - Send with PDF attachment

### 2. Google Sheets to PDF report

```
[Google Sheets: Watch Rows] → [HTTP: Generate PDF] → [Google Drive: Upload]
```

**Trigger:** Google Sheets - Watch New Rows
**Action 1:** HTTP - Generate PDF from row data
**Action 2:** Google Drive - Upload file to folder

### 3. Stripe payment to invoice

```
[Stripe: Watch Events] → [HTTP: Generate Invoice PDF] → [Dropbox: Upload]
```

**Trigger:** Stripe - Watch Events (payment completed)
**Action 1:** HTTP - Generate invoice PDF
**Action 2:** Dropbox - Upload File

### 4. Airtable record to certificate

```
[Airtable: Watch Records] → [HTTP: Generate Certificate] → [Gmail: Send]
```

**Trigger:** Airtable - Watch Records
**Action 1:** HTTP - Generate certificate PDF
**Action 2:** Gmail - Send email with attachment

### 5. Scheduled report

```
[Schedule] → [Database Query] → [HTTP: Generate Report] → [Slack: Post Message]
```

**Trigger:** Schedule - Run at specific time
**Action 1:** Query your database for data
**Action 2:** HTTP - Generate PDF report
**Action 3:** Slack - Post link to report

---

## API endpoints

Configure your HTTP module with these endpoints:

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/htmlToPdf` | POST | Convert HTML to PDF |
| `/textToPdf` | POST | Convert plain text to PDF |
| `/imageToPdf` | POST | Convert images to PDF |
| `/pdfToImage` | POST | Convert PDF pages to images |
| `/extractText` | POST | Extract text from PDF |
| `/extractPages` | POST | Extract specific pages |
| `/mergePdfs` | POST | Combine multiple PDFs |
| `/pageCount` | POST | Get PDF page count |

See the [API reference](https://pdf-mcp.io/docs/api-reference) for request and response details.

---

## cURL examples

Test the API directly before configuring Make:

### Basic HTML to PDF request

```bash
curl -X POST https://api.pdf-mcp.io/htmlToPdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Hello, World!</h1><p>Generated from Make scenario.</p>"
  }' \
  --output document.pdf
```

### Styled invoice

```bash
curl -X POST https://api.pdf-mcp.io/htmlToPdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<!DOCTYPE html><html><head><title>Invoice</title></head><body><h1>Invoice #12345</h1><table><tr><th>Item</th><th>Amount</th></tr><tr><td>Service Fee</td><td>$99.00</td></tr></table><p>Total: $99.00</p></body></html>",
    "css": "@page { size: A4; margin: 2cm; } body { font-family: Arial, sans-serif; } table { width: 100%; border-collapse: collapse; } th, td { border: 1px solid #ddd; padding: 8px; }",
    "filename": "invoice-12345.pdf"
  }' \
  --output invoice-12345.pdf
```

### Text to PDF

```bash
curl -X POST https://api.pdf-mcp.io/textToPdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Meeting Notes\n\nDate: January 15, 2025\n\n1. Project status review\n2. Timeline discussion\n3. Next steps",
    "filename": "meeting-notes.pdf"
  }' \
  --output meeting-notes.pdf
```

---

## MCP clients

> For an MCP client, enter the hosted Streamable HTTP URL directly. There is no pdf-mcp package or local server to install. See the verified [MCP client setup guide](https://pdf-mcp.io/docs/mcp-server).

---

## Handle the response

The HTTP module returns the PDF as binary data. Map that output into the next module that needs the file.

### Save to cloud storage

Connect to Google Drive, Dropbox, OneDrive, or other storage modules:

1. Add a storage module after the HTTP module
2. Map the `data` output from the HTTP module to the file content
3. Specify the filename and destination folder

### Send by email

Use Gmail, Outlook, or other email modules:

1. Add an email module after the HTTP module
2. In the attachment field, map the HTTP module's response data
3. Set the attachment filename

### Download locally during testing

Use the **Make DevTool** browser extension to download files during testing.

### Store in a database

Encode the binary data as base64 and store in your database if needed.

---

## Work with binary data

Make handles binary data through its data bundles. To work with PDF files:

### Pass data to a storage module

Most storage modules (Google Drive, Dropbox, etc.) accept binary data directly:

1. In the file content field, select the `data` output from the HTTP module
2. Specify the filename with `.pdf` extension

### Pass data to an email attachment

Email modules typically accept binary attachments:

1. Map the HTTP response body to the attachment data
2. Set the filename (e.g., `document.pdf`)
3. Set the content type to `application/pdf`

### Convert to base64

If you need base64 encoding, use Make's `toString` function:

```
{{toString(HTTP_MODULE.data; "base64")}}
```

---

## Error handling

Make can route failures through error handlers.

### Common status codes

| Code | Description | Solution |
|------|-------------|----------|
| 200 | Success | PDF generated successfully |
| 401 | Unauthorized | Check your API key in headers |
| 402 | Payment Required | Add credits to the account |
| 403 | Forbidden | Verify API key permissions |
| 400 | Bad Request | Check your request body format |
| 500 | Server Error | Review HTML syntax or contact support |

### Add an error handler

1. Right-click on the HTTP module
2. Select **Add error handler**
3. Choose the handler type:
   - **Resume**: Continue with default value
   - **Rollback**: Undo previous operations
   - **Commit**: Save completed operations
   - **Ignore**: Skip errors silently

### Route success and error paths

Add a Router after the HTTP module to handle success and error cases separately:

```
[HTTP Module] → [Router]
                  ├── Route 1: Status = 200 → [Continue with PDF]
                  └── Route 2: Status != 200 → [Send Alert/Log Error]
```

Configure the router filters:
- Route 1 filter: `{{HTTP_MODULE.statusCode}} = 200`
- Route 2 filter: `{{HTTP_MODULE.statusCode}} != 200`

---

## Troubleshooting

### PDF is empty or not generated

- Verify your API key is correct and has credits
- Check that the `html` field contains valid HTML
- Ensure the JSON is properly formatted
- Test with a simple HTML string first

### Authentication errors (401/403)

- Check the Authorization header format: `Bearer YOUR_API_KEY`
- Ensure there's a space between "Bearer" and your key
- Verify your API key hasn't been revoked

### Insufficient credits (402)

- Check your credit balance in the dashboard

### Module timeout

- Large or complex HTML may take longer to process
- Increase the timeout in advanced settings (Settings > Timeout)
- Simplify your HTML template
- Use inline styles instead of external resources

### Invalid JSON errors

- Validate your JSON in the Make editor
- Escape special characters in strings (use `\"` for quotes)
- Check for trailing commas or missing brackets
- Use Make's JSON functions for complex data

### Variable mapping issues

- Verify module numbers match your scenario layout
- Use the variable picker to ensure correct paths
- Test each module individually with hardcoded values
- Check that trigger data contains expected fields

### Binary data not recognized

- Ensure **Parse response** is set correctly
- Some downstream modules need specific content types
- Try base64 encoding for problematic integrations

---

## Implementation notes

### Performance

- Keep HTML simple for faster generation
- Use inline CSS instead of external stylesheets
- Compress images before including them
- Avoid unnecessary complexity in templates

### Reliability

- Test scenarios thoroughly before activating
- Use Make's execution history to debug issues
- Set up error notifications for critical scenarios
- Schedule non-urgent operations during off-peak hours

### Security

- Never expose your API key in shared scenarios
- Use Make's connection feature for secure credential storage
- Limit scenario sharing to trusted team members
- Review data exposure in public scenarios

### Credit usage

- Use filters to only generate PDFs when necessary
- Batch similar operations with iterators
- Monitor API credit usage regularly
- Set up alerts for high usage

### Organization

- Name your modules descriptively
- Add notes to complex scenarios
- Group related modules with labels
- Use folders to organize scenarios

---

## Make function reference

These Make functions can prepare values for PDF requests:

| Function | Description | Example |
|----------|-------------|---------|
| `formatDate` | Format dates | `{{formatDate(now; "YYYY-MM-DD")}}` |
| `toString` | Convert to string | `{{toString(1.amount)}}` |
| `replace` | Replace text | `{{replace(1.html; "\n"; "<br>")}}` |
| `join` | Join array items | `{{join(1.items; ", ")}}` |
| `parseNumber` | Parse numbers | `{{parseNumber(1.price)}}` |

---

## Related documentation

- [Quick start](https://pdf-mcp.io/docs/quick-start): get an API key
- [HTML to PDF](https://pdf-mcp.io/docs/api-html-to-pdf): endpoint details
- [API reference](https://pdf-mcp.io/docs/api-reference): all available endpoints
- [MCP server](https://pdf-mcp.io/docs/mcp-server): AI agent integration
- [n8n integration](https://pdf-mcp.io/docs/integration-n8n): n8n setup
- [Zapier integration](https://pdf-mcp.io/docs/integration-zapier): Zapier setup

---

## Credit usage

Make requests use the same credits as direct API requests:

- **HTML to PDF**: 1 credit for the first page, plus 0.01 per additional page
- **Render template**: 1 credit for the first page, plus 0.01 per additional page
- **PDF to image**: 1 credit for the first page, plus 0.01 per additional page
- **AI template generation**: 1 credit per successful message
- **Other PDF utilities, including form operations and file search**: 0.01 credits per request
- **Direct file, template, asset, and theme management**: free

The [dashboard](https://app.pdf-mcp.io) shows current usage.
