# PDFShift MCP

> PDFShift converts web pages, URLs, or raw HTML content into professional documents and images. It lets your agent capture complex layouts—including CSS and JavaScript—and generate multi-format files like PDF, PNG, JPEG, and WebP automatically. Use it to build dynamic reports or create consistent assets without maintaining local rendering engines.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** pdf-generation, html-to-pdf, web-capture, document-automation, api-conversion

## Description

Need to take a live webpage or a chunk of HTML code and turn it into something usable? This MCP bridges the gap between web content and print-ready files. You can send your AI agent any URL, and it will return that content converted instantly to PDF, PNG, JPEG, WebP, or even generate complex documents from stored templates. The system handles everything difficult about modern web layouts—the JavaScript, the CSS, the headers, footers—making sure your final document looks exactly right. If you're managing many different assets, like invoices or receipts that need to look identical every time, you can store HTML templates and then use those templates to generate new documents with unique data. Once you subscribe to this MCP on Vinkius, your agent gets instant access to all these conversion and document generation tools, letting you focus solely on the content, not the formatting.

## Tools

### convert_to_jpeg
Turns a URL or HTML string into a JPEG image file.

### convert_to_pdf
Converts a specified URL or raw HTML content directly into a PDF document, providing an S3 link for retrieval.

### convert_to_png
Turns a URL or HTML string into a PNG image file.

### convert_to_webp
Converts a URL or HTML string into the modern WebP image format.

### create_template
Saves and registers a new reusable document blueprint using provided HTML content.

### delete_template
Removes an existing template from your stored library.

### generate_from_template
Creates a final document by merging dynamic data into a predefined HTML template.

### get_account
Retrieves detailed information about your current account status and settings.

### get_credits_usage
Checks how many conversion credits you have used so far this billing cycle.

### get_log
Retrieves a specific log entry using its unique request ID number.

### get_template_html
Fetches the raw HTML content of a template by name or ID for review.

### list_invoices
Displays a list of your past billing invoices and payment records.

### list_logs
Retrieves a list of the most recent conversion attempts, including status codes and source URLs.

### list_templates
Shows all document templates currently saved and available in your account library.

### update_template
Modifies the content or metadata of an existing template that you previously created.

## Prompt Examples

**Prompt:** 
```
Convert https://news.ycombinator.com to a PDF in landscape orientation.
```

**Response:** 
```
I've initiated the conversion for Hacker News. The PDF has been generated in landscape mode. [Download Link/Binary Data]
```

**Prompt:** 
```
List all my saved HTML templates and show the credits I have left.
```

**Response:** 
```
You have 3 templates: 'invoice-v1', 'report-monthly', and 'welcome-email'. Your current balance is 450 credits.
```

**Prompt:** 
```
Show me the logs for my last 5 conversion attempts.
```

**Response:** 
```
Fetching your recent logs... Here are the last 5 conversions, including status codes, source URLs, and processing times.
```

## Capabilities

### Capture Web Content
Convert a live URL or raw HTML string into high-quality image formats (PNG, JPEG, WebP) or professional PDF documents.

### Generate Templated Documents
Store reusable HTML blueprints and dynamically populate them to generate structured reports, invoices, or certificates.

### Manage Account Usage
Track your credit consumption, view detailed logs of past conversions, and list billing invoices directly through your agent.

## Use Cases

### Legal team needs to archive meeting notes
A paralegal has 15 internal dashboards built in HTML. Instead of running a local script for each one, they ask their agent to run the conversion through `convert_to_pdf` on all relevant URLs and get 15 shareable PDF reports instantly.

### Marketing team needs social media previews
A content manager writes a new blog post. They ask their agent to convert the article's URL into three different formats—PNG for Instagram, JPEG for Facebook, and PDF for archive—using multiple conversion tools.

### Finance department needs standardized invoices
Instead of manually updating an invoice template every month, the operations analyst uses `create_template` to build a master invoice. Later, they use `generate_from_template`, passing in client names and totals, and receive multiple clean PDF reports.

### Dev team needs reliable testing assets
A developer wants to test how their application looks on paper for a stakeholder presentation. They ask the agent to capture a specific HTML section using `convert_to_pdf` and get the resulting S3 URL.

## Benefits

- Get pixel-perfect results every time. Whether you use `convert_to_pdf` or `convert_to_png`, the system handles complex CSS and JavaScript so your final output matches the source exactly.
- Build predictable documents with templates. Instead of manually formatting reports, use `create_template` to build a master blueprint and then fill it out using `generate_from_template` for consistency.
- Monitor usage without checking dashboards. Use `get_credits_usage` or `list_logs` through your agent to keep track of conversions and billing in one prompt.
- Capture multiple formats with one tool. You don't just get PDFs; you can also generate high-quality JPEG, PNG, or WebP images from the same source content using dedicated tools like `convert_to_jpeg`.
- Simplify complex operations. Instead of needing a local server setup, your agent handles all the conversion logic, letting developers and analysts focus on the data flow.

## How It Works

The bottom line is you tell your agent what content and format you want; the MCP handles all the complex web rendering and spits out the ready-to-use file.

1. First, you subscribe to this MCP on Vinkius and provide the necessary API key.
2. Next, you instruct your AI client to perform a conversion or generation task (e.g., 'Convert this URL to PDF' or 'Generate a document using template X').
3. Finally, the system returns the resulting file data, often providing a direct link or S3 URL for immediate download.

## Frequently Asked Questions

**How do I convert an HTML snippet to PDF with PDFShift?**
You can pass the raw HTML string directly as input when calling `convert_to_pdf`. This allows you to generate a PDF from content that isn't hosted at a specific URL.

**Can I use PDFShift to make branded documents?**
Yes. Use the `create_template` tool first to build your master document blueprint, and then use `generate_from_template` to fill it with unique data for each client.

**Is there a way to track my PDFShift usage?**
Absolutely. You can check your consumption by calling `get_credits_usage`, or you can see historical attempts and statuses using the `list_logs` tool.

**Does PDFShift only convert full web pages?**
No, it's versatile. You can also use specific tools like `convert_to_png` or `convert_to_jpeg` to capture just a segment of an HTML page or a URL.

**What if my template needs updating?**
You should first run `get_template_html` to view the current structure, and then use `update_template` to modify it before regenerating any documents.