# PDFShift MCP for AI Agents AI Agent Connect

> PDFShift converts URLs or HTML into high-fidelity PDFs and images like PNG, JPEG, and WebP. It handles complex layouts, manages reusable HTML templates, and supports cloud exports to S3 or Google Storage. Use it to automate document generation via a high-performance API without managing your own headless browser.

## Overview
- **Category:** productivity
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_eFUtIIlmUi8wiZ9um42caJb4t60HbsbZZhY0vd6N/ai-agent-connect
- **Tags:** pdf-generation, html-to-pdf, web-capture, document-automation, api-conversion

## Description

PDFShift lets your AI agent turn web pages into polished, production-ready documents in seconds. Instead of worrying about how a browser renders a complex layout or trying to capture a specific element without it breaking, you just give your agent a URL or a block of HTML. It handles the heavy lifting of CSS and JavaScript to ensure the final file looks exactly like the live site. You can use it to build dynamic reports by creating and storing reusable templates, or just grab a quick preview image for a social post. Because it connects through the Vinkius catalog, you can quickly plug this into your existing workflow to handle bulk document generation. It's built for speed, so whether you're generating hundreds of invoices or just one specific report, the results are consistent and ready for distribution. You get granular control over everything from page margins to viewports, making it a reliable way to turn messy web data into clean, shareable files.

## Tools

### convert_to_pdf
Convert a URL or HTML to a PDF file. You can also provide a filename to receive a direct S3 URL.

### convert_to_png
Turn a URL or HTML content into a PNG image. This is ideal for high-quality web screenshots.

### convert_to_webp
Convert a URL or HTML content into a WebP image. Use this for fast-loading images on modern websites.

### create_template
Save a new HTML template for future document generation. This ensures your layout stays consistent over time.

### delete_template
Remove an existing HTML template from your account. Use this to clean up old designs you no longer need.

### generate_from_template
Create a document using one of your saved HTML templates. This is the fastest way to generate recurring documents.

### get_account
Fetch your current account details and status. Use this to check your current plan and profile info.

### get_credits_usage
Check how many conversion credits you have left. This helps you stay on top of your usage limits.

### list_logs
See a list of your most recent conversion logs. This is great for a quick overview of recent activity.

### list_templates
See all the HTML templates you've saved in your account. Use this to manage your library of designs.

### update_template
Modify the HTML content of an existing saved template. Use this to make small tweaks to your layouts.

### get_log
Retrieve specific request logs using a request ID. This helps you debug failed conversions or check processing times.

### convert_to_jpeg
Turn a URL or HTML content into a JPEG image. Use this for standard photo-style web captures.

### get_template_html
Fetch the HTML content of a saved template. This lets you see the underlying structure of your saved designs.

### list_invoices
View all billing invoices associated with your account. Use this to keep track of your subscription costs.

## Prompt Examples

**Prompt:** 
```
Convert the latest news from the Hacker News homepage to a PDF and give me the link.
```

**Response:** 
```
I've started the conversion for Hacker News. You can download the high-quality PDF here: **[Link]**. It's captured in standard portrait orientation and preserves the original layout.
```

**Prompt:** 
```
Create a social media preview image for my blog post at [URL].
```

**Response:** 
```
I've generated a high-quality WebP image for your blog post. Here is the preview: **[Image]**. It's optimized for fast loading on social platforms.
```

**Prompt:** 
```
List my templates and show me how many credits I have left.
```

**Response:** 
```
You have 3 saved templates: 

* **monthly_report**
* **invoice_v2**
* **welcome_letter**

Your current credit balance is **1,250**.
```

## Capabilities

### Convert web pages to PDF
Turn any live URL into a high-quality PDF document.

### Create image previews
Generate PNG, JPEG, or WebP versions of web content.

### Manage HTML templates
Store and reuse custom HTML for consistent document layouts.

### Export to cloud storage
Send generated files directly to S3 or Google Cloud Storage.

### Automate via webhooks
Receive conversion results asynchronously for multi-step workflows.

### Track usage and logs
Monitor your API credits and check request history.

## Use Cases

### Automating Invoices
A developer needs to send 500 invoices a month. They ask the agent to take internal data, plug it into a template, and use generate_from_template to create a PDF for each customer.

### Social Media Previews
A content manager wants to share a blog post on X. They ask the agent to turn the URL into a high-quality WebP image using convert_to_webp for a quick upload.

### Stakeholder Reporting
An ops lead needs a snapshot of a live dashboard. They ask the agent to use convert_to_pdf on the dashboard URL to create a shareable report for the board meeting.

### Web Archiving
A researcher needs to save a specific news page. They ask the agent to capture the URL as a PNG using convert_to_png to preserve the layout for their records.

## Benefits

- No more headless browser headaches: Use convert_to_pdf to handle complex CSS and JS without maintaining your own server infrastructure.
- Consistent branding: Save layouts with create_template and update_template to ensure every document looks exactly the same.
- Faster workflows: Use generate_from_template to create documents instantly instead of sending raw HTML every time.
- Cloud-native exports: Send files directly to S3 or Google Storage to keep your files organized and accessible.
- Real-time tracking: Monitor your costs and history using get_credits_usage and list_logs to keep your project on budget.

## How It Works

The bottom line is you get a high-fidelity document conversion engine that handles the browser complexity for you.

1. Connect your PDFShift API key to your AI client.
2. Provide a URL, HTML string, or a template ID to your agent.
3. Receive a download link or a direct file export to your cloud storage.

## Frequently Asked Questions

**Can PDFShift handle websites with complex JavaScript?**
Yes, it renders the page just like a browser would, so it handles modern web layouts and scripts perfectly.

**Can I save my own layouts for repeated use?**
You can use the template system to save HTML structures, then just tell your agent to fill them with new data.

**Does it support different image formats?**
Yes, it can convert web content into JPEG, PNG, and WebP, depending on what your workflow requires.

**How do I get the files into my own cloud storage?**
The Connector can export your generated documents directly to S3 or Google Cloud Storage automatically.

**Can I get a URL for the PDF instead of a raw file?**
Yes, if you provide a filename, the tool returns a JSON response with a direct S3 URL.

**Is there a way to see my conversion history?**
You can ask your agent to list your recent logs to see status codes and processing times for your last few requests.

**Can I test the conversion without spending my credits?**
Yes. Use the `sandbox` parameter set to `true` in tools like `convert_to_pdf`. This generates a watermarked document for development purposes at no credit cost.

**How do I generate a document using a saved template?**
First, ensure your template is created using `create_template`. Then, use `generate_from_template` providing the template slug and the dynamic data you want to inject.

**Can I capture a full-page screenshot as an image?**
Absolutely. Use `convert_to_png`, `convert_to_jpeg`, or `convert_to_webp` and set the `fullpage` parameter to `true` to capture the entire scrollable area.