# PDFShift MCP for AI Agents AI Agent Connect

> PDFShift lets you turn URLs, HTML strings, and web pages into high-quality PDF or image files. It handles complex CSS and JavaScript, supports custom templates for consistent branding, and manages your usage credits automatically. Perfect for automating document generation at scale without managing local infrastructure.

## 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 connects your AI agent to a high-performance conversion engine that transforms web content into professional documents. Instead of wrestling with headless browsers or trying to scrape messy content, you can just ask your agent to grab a live URL or a block of HTML and turn it into a polished PDF, JPEG, or WebP file. It handles the heavy lifting of rendering complex layouts, headers, and footers so you don't have to. You can create reusable HTML templates for things like invoices or reports, and the agent can fill them in dynamically. If you're looking for a way to get consistent, pixel-perfect results without the headache of local setup, this is the right move. Vinkius makes it easy to connect this to your preferred AI client and access it alongside a catalog of thousands of other tools. You get the ability to export straight to S3 or Google Storage or trigger webhooks for automated pipelines. It's about moving from "here's a link" to "here's the finished file" in one step. You can manage your usage, view logs, and keep your billing in check all from within your agent's interface. It's a reliable way to turn web data into shareable assets without the technical debt of maintaining your own rendering stack.

## Tools

### convert_to_pdf
Convert a URL or HTML string into a PDF file. You can also get a JSON response with an S3 URL instead of raw binary.

### convert_to_png
Create a transparent or solid PNG image from a web page or HTML. This is ideal for UI assets.

### convert_to_webp
Generate WebP images from URLs to save on file size while keeping high visual quality.

### create_template
Save a new HTML template for repeated document generation. This ensures your output stays consistent every time.

### delete_template
Remove an existing template from your saved list to keep your workspace clean.

### generate_from_template
Create a new document using one of your saved HTML templates. This allows for dynamic data injection into fixed designs.

### get_account
Check your current account details and status. Use this to verify your connection and profile.

### get_credits_usage
See how many credits you have left for conversions. This helps you manage your budget in real-time.

### list_logs
View a list of your most recent conversion attempts. It's the quickest way to see if a task succeeded.

### list_templates
See all the HTML templates you have currently saved. This helps you organize your reusable designs.

### update_template
Modify the HTML content of an existing template. Use this to tweak your designs without creating new ones.

### get_log
Retrieve details for a specific conversion request using its unique ID. This helps you check the status of a specific task.

### convert_to_jpeg
Turn a URL or HTML block into a high-quality JPEG image. This is great for creating static web captures.

### get_template_html
Fetch the raw HTML content of a saved template. Use this to see what your current designs look like.

### list_invoices
View your billing history and past invoices. It keeps your spending transparent and easy to track.

## Prompt Examples

**Prompt:** 
```
Convert this URL to a PDF in landscape mode: https://example.com/report
```

**Response:** 
```
I've started the conversion for that report. I'm rendering it in landscape mode now. You'll receive a download link for the PDF shortly.
```

**Prompt:** 
```
List my templates and show my credit balance.
```

**Response:** 
```
Here are your saved templates:
- **monthly_invoice**
- **receipt_v2**
- **newsletter_arch**

Your current credit balance is **450 credits**.
```

**Prompt:** 
```
Create a PNG of this HTML snippet: <div><h1>Hello World</h1><p>This is a test.</p></div>
```

**Response:** 
```
I've generated that image for you. You can find the PNG file at the link below:

[Link to PNG]
```

## Capabilities

### Convert URLs to PDF
Turn any live web page into a multi-page PDF document while preserving complex layouts.

### Generate images from HTML
Create PNG, JPEG, or WebP files from raw HTML strings for social previews or assets.

### Manage document templates
Store and reuse HTML structures to ensure every generated document follows your brand guidelines.

### Export to cloud storage
Send generated files directly to S3 or Google Storage for immediate use in your pipeline.

### Track account usage
Monitor your credit balance and billing history directly through your AI agent.

### Fetch conversion logs
Check the status and history of previous rendering tasks to troubleshoot issues quickly.

## Use Cases

### Automated Invoicing
A developer asks the agent to take a JSON order and turn it into a PDF invoice using a saved template.

### Social Media Previews
A content creator asks for a PNG preview of a new blog post URL to share on social media.

### Report Archiving
An ops lead asks the agent to convert a live dashboard URL into a PDF for a weekly board meeting.

### Dynamic Web Captures
A researcher asks the agent to save a specific news article as a WebP image for a private archive.

## Benefits

- Stop managing headless browsers. Use convert_to_pdf to handle complex CSS and JavaScript rendering without local setup.
- Create consistent branding. Use create_template and generate_from_template to ensure every invoice or report looks the same.
- Save on storage costs. Use the S3 and Google Storage export features to move files off your local environment immediately.
- Get real-time status updates. Use list_logs and get_log to track the success of high-volume conversion tasks.
- Reduce manual work. Use convert_to_webp and convert_to_png to automate the creation of social media assets.
- Track your spending. Use get_credits_usage and list_invoices to keep your billing and usage in check.

## How It Works

The bottom line is you get a production-ready document generation pipeline without managing any infrastructure.

1. Add your PDFShift API key to your environment variables.
2. Connect the Connector to your AI client via the Vinkius catalog.
3. Ask your agent to convert a URL or HTML snippet into a specific file format.

## Frequently Asked Questions

**Can PDFShift handle complex websites with JavaScript?**
Yes, it renders modern web layouts including JavaScript and complex CSS to ensure your PDFs look exactly like the live site.

**How do I use PDFShift to create consistent invoices?**
You can save an HTML design as a template and have your AI agent fill in the specific data for each new invoice.

**Can I save the generated files directly to my cloud storage?**
Yes, the Connector supports exporting files directly to S3 and Google Storage so you don't have to download them manually.

**What image formats can I convert web pages into?**
You can convert URLs or HTML into JPEG, PNG, and WebP formats depending on your needs.

**How do I keep track of my usage and billing?**
You can ask your agent to check your account details, view your credit usage, or list your recent invoices.

**Can I use PDFShift for high-volume document generation?**
Yes, it's built for high performance and can handle batch conversions through automated workflows.

**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.