---
canonical: 'https://htmlcsstoimage.com/features/url-to-pdf'
title: 'URL to PDF API - Convert Webpages to PDF | HTML/CSS to Image'
description: 'Convert a public URL or webpage to PDF with one API. Control page size, margins, print backgrounds, browser settings, and capture timing.'
---

# Convert a webpage to PDF with one API call

Send a public URL and choose the browser and PDF settings. Headless Chromium loads the page and returns the generated PDF URL.

## Key capabilities

- Public webpage input
- JavaScript-rendered pages
- Custom PDF size and margins

## How the URL to PDF API works

Send a public webpage URL to `POST https://hcti.io/v1/image` with `pdf_options`. HTML/CSS to Image (HCTI) loads it in Chromium before generating the PDF. Browser controls cover JavaScript-rendered content, capture timing, color scheme, timezone, and print media. The response includes the generated PDF URL.

The page must be reachable by HCTI. Pages that require a specific source network can use a saved proxy, but a site may still return a login, rate-limit, or browser-challenge page instead of its normal content.

If the content is not available as a public webpage, use the HTML-to-PDF API and send its HTML and CSS instead.

## Control the PDF layout

Set the PDF page width, height, scale, print backgrounds, and each margin in the same API request.

```json
{
  "pdf_options": {
    "page_width": "8.5in",
    "page_height": "11in",
    "margins": ["0.4in", "0.4in", "0.4in", "0.4in"],
    "print_background": true
  }
}
```

PDF output is available on supported plans. Check [pricing](https://htmlcsstoimage.com/pricing.md) for current availability.

## MCP Integration

Connect an MCP-compatible client to `https://mcp.hcti.io` with OAuth. The tools use the connected organization's HTML/CSS to Image account, permissions, and plan limits.

- The `create_url_image` tool accepts a webpage URL with `pdf_options` and returns the generated PDF URL. Include browser timing and print controls for JavaScript-rendered pages.

[Read the full MCP docs](https://docs.htmlcsstoimage.com/integrations/mcp/).

## Save public webpages as PDF files

### Webpage archives

Save the rendered version of a public page as a dated PDF for records and review.

### Public reports

Convert browser-rendered reports, charts, and dashboards into downloadable PDF files.

### Articles and documentation

Create printable copies of articles, release notes, documentation, and reference pages.

### Landing pages

Capture published campaign and client pages as PDFs for distribution, approval, and historical reference.

## Get started

REST API requests require an HTML/CSS to Image account and should be authenticated from trusted application code. Check the API docs and pricing for current setup instructions, limits, and feature availability.

- [View the full feature page](https://htmlcsstoimage.com/features/url-to-pdf)
- [Browse all features](https://htmlcsstoimage.com/features.md)
- [Start free](https://htmlcsstoimage.com/join)
- [View pricing](https://htmlcsstoimage.com/pricing.md)
- [Read the PDF docs](https://docs.htmlcsstoimage.com/parameters/pdf_options/)
- [Read the MCP docs](https://docs.htmlcsstoimage.com/integrations/mcp/)
