---
title: Convert Webpage to PDF FIle API
slug: convert-webpage-to-pdf-file
url: https://apyhub.com/frolic/service/convert-webpage-to-pdf-file
provider: Hakimi Labs
categories: [Output Kit, Media Kit]
tags: [web-to-pdf, html-to-pdf, page-rendering, pdfa, document-export]
auth: api_key
version: 1.0
service_type: sync
endpoints: 1
atoms: 25
mcp: true
---

# Convert Webpage to PDF FIle API

Convert a public URL into a PDF binary with paper size, margins, headers, footers, and PDF/A options. Useful for archiving web pages and exporting reports.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/frolic/convert-webpage-to-pdf-file/url-to-pdf` | What it does Converts a public HTTP(S) webpage URL into a PDF. You send the page URL in the request… | 25 |

## Endpoint reference

### URL to PDF

`POST https://api.eu.apyhub.com/frolic/convert-webpage-to-pdf-file/url-to-pdf` · 25 atoms · accepts `application/x-www-form-urlencoded` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string | yes | Public http(s) URL of the page Example: `https://example.com`. |
| `pdfa` | body | string | no | Archival format: PDF/A-1b, PDF/A-2b or PDF/A-3b One of: PDF/A-1b, PDF/A-2b, PDF/A-3b. |
| `paper` | body | string | no | A3, A4 (default), A5, A6, Letter, Legal or Tabloid One of: A3, A4, A5, A6, Letter, Legal, Tabloid. |
| `landscape` | body | boolean | no | Landscape pages (default false) |
| `margin_top` | body | number (double) | no | Top margin in inches (0-4, default 0.39) |
| `wait_delay` | body | integer (int32) | no | Seconds to wait after the page loads, for JavaScript-heavy pages (0-10) |
| `footer_html` | body | string | no | HTML repeated at the bottom of every page; same placeholders as header_html |
| `header_html` | body | string | no | HTML repeated at the top of every page. <span class="pageNumber"></span> and <span class="totalPages"></span> are filled in |
| `margin_left` | body | number (double) | no | Left margin in inches (0-4, default 0.39) |
| `margin_right` | body | number (double) | no | Right margin in inches (0-4, default 0.39) |
| `margin_bottom` | body | number (double) | no | Bottom margin in inches (0-4, default 0.39) |
| `print_background` | body | boolean | no | Print background colours and images (default true) |

#### Quickstart

Convert a web page to PDF by sending its URL as form data.

```bash
curl -X POST "https://api.eu.apyhub.com/frolic/convert-webpage-to-pdf-file/url-to-pdf" \
  -H "apy-token: $APY_TOKEN" \
  --data-urlencode "url=https://apyhub.com"
```

#### What you'll get back

Returns a binary PDF file (`string` with `format: binary`), not a JSON object.

## About

## What it does
Web Page to PDF converts a public HTTP or HTTPS URL into a PDF binary. Send a page URL and get back a downloadable PDF, with support for common document settings like paper size, orientation, margins, background printing, and optional PDF/A archival formats.

Use it when you need to capture a live webpage as a fixed document for sharing, archiving, review, or record-keeping. It handles standard paper formats including A4, Letter, Legal, Tabloid, A3, A5, and A6, so you can fit the output to your workflow or print pipeline.

For pages that depend on JavaScript, you can add a wait delay before rendering. You can also supply header and footer HTML that repeats on every page, including page number and total pages placeholders. That makes it a good fit for invoice exports, compliance snapshots, saved reports, and customer-facing document generation from web content.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/frolic/service/convert-webpage-to-pdf-file
