What it does
Capture a public web address or your own HTML as a PDF, or as a PNG, JPEG or WebP image: the first screen or the whole page, at desktop, laptop, tablet or phone width.
It reads one HTM, HTML, TXT or URL file. You get: a PDF or an image of the page.
Step by step on the website
Use Web page to PDF or image
Open Web page to PDF or image on the website.
Open Web page to PDF or imageEnter a web address, or drop an HTML file on the page.
Choose your settings, or keep the ones already chosen:
- Source: HTML or Web address (HTML at first). html renders the uploaded HTML with scripts off; url captures a public web address.
- Web address: type the web address. A public page, such as https://example.com. Appears when Source is Web address.
- Save as: PDF, PNG, JPEG or WebP (PDF at first). What to make: a PDF, or a PNG, JPEG or WebP image.
- Page size: A4, Letter, Legal or A3 (A4 at first). The size of each output page. Appears when Save as is PDF.
- Orientation: Portrait or Landscape (Portrait at first). Upright or sideways pages. Appears when Save as is PDF.
- Margin: None, Small or Large (Small at first). Space kept clear at the page edge. Appears when Save as is PDF.
- Whole page: switch it on or off (Off at first). Capture everything down to the bottom, not just the first screen.
- Screen: Desktop, Laptop, Tablet or Phone (Desktop at first). The screen size the page is drawn at.
- Quality: a number from 1 to 100% (86% at first). Higher keeps more detail and makes a larger file. Appears when Save as is JPEG or WebP.
- Transparent background: switch it on or off (Off at first). Keep the page background transparent. PNG only. Appears when Save as is PNG.
- Block ads: switch it on or off (Off at first). Skip adverts while the page loads. Appears when Save as is PDF.
- Remove pop-ups: switch it on or off (Off at first). Hide cookie banners and pop-ups before capture. Appears when Save as is PDF.
To fine-tune, open More options:
- Window width: a number from 320 to 2400 px. The browser window width the page is drawn at.
- Window height: a number from 240 to 2400 px. The browser window height the page is drawn at.
- Wait before capture: a number from 0 to 3 s. Time for the page to finish drawing.
- File name: type a name, or keep the one suggested. Optional. The extension is added for you.
Select Web page to PDF or image to run it.
When it finishes, select Download to save your PDF file.
Settings
Every setting, with the name the page shows and the name the API uses. On the page: shown next to your file. More options: under More options. API only: not offered on the website.
| Setting | API name | Choices or values | Default | Where | What it does |
|---|---|---|---|---|---|
| Source | source | HTML (html), Web address (url) | HTML | On the page | html renders the uploaded HTML with scripts off; url captures a public web address. |
| Web address | url | Text | On the page, when Source is Web address | A public page, such as https://example.com. | |
| Save as | output | PDF (pdf), PNG (png), JPEG (jpeg), WebP (webp) | On the page | What to make: a PDF, or a PNG, JPEG or WebP image. | |
| Page size | pageSize | A4, Letter, Legal, A3 | A4 | On the page, when Save as is PDF | The size of each output page. |
| Orientation | orientation | Portrait (portrait), Landscape (landscape) | Portrait | On the page, when Save as is PDF | Upright or sideways pages. |
| Margin | margin | None (no-margin), Small (small), Large (big) | Small | On the page, when Save as is PDF | Space kept clear at the page edge. |
| Whole page | fullPage | On (true), Off (false) | Off | On the page | Capture everything down to the bottom, not just the first screen. |
| Screen | screenSize | Desktop (desktop), Laptop (laptop), Tablet (tablet), Phone (mobile) | Desktop | On the page | The screen size the page is drawn at. |
| Window width | viewportWidth | 320 to 2400 px | More options | The browser window width the page is drawn at. | |
| Window height | viewportHeight | 240 to 2400 px | More options | The browser window height the page is drawn at. | |
| Wait before capture | delayMs | 0 to 3000 ms | More options | Time for the page to finish drawing. | |
| Quality | quality | 1 to 100% | 86 | On the page, when Save as is JPEG or WebP | Higher keeps more detail and makes a larger file. |
| Transparent background | transparentBackground | On (true), Off (false) | Off | On the page, when Save as is PNG | Keep the page background transparent. PNG only. |
| Block ads | blockAds | On (true), Off (false) | Off | On the page, when Save as is PDF | Skip adverts while the page loads. |
| Remove pop-ups | removeOverlays | On (true), Off (false) | Off | On the page, when Save as is PDF | Hide cookie banners and pop-ups before capture. |
| File name | outputName | Text | More options | Optional. The extension is added for you. |
Run it with the API
Upload your file with POST /api/v2/documents, then start Web page to PDF or image with POST /api/v2/document-operations and toolId web-capture. The parameters use the API names in the settings table; anything you leave out takes its default. Read the operation until its state is completed, then download the output version.
The request below uses the same starting settings as the website. The script after it does the whole journey: upload, run, wait and download.
{
"documentId": "doc_8kq2W1",
"versionId": "ver_3Jx9Lm",
"toolId": "web-capture",
"parameters": {},
"idempotencyKey": "web-capture-2026-11-22-1"
}#!/usr/bin/env bash
# Needs curl and jq.
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
set -euo pipefail
API="${WELLFRIEND_API_URL:-https://wellfriend.dev}"
WELLFRIEND_API_KEY="${WELLFRIEND_API_KEY:-YOUR_API_KEY}"
AUTH="Authorization: Bearer $WELLFRIEND_API_KEY"
RUN=$(uuidgen) # reuse this value to retry safely
# upload FILE CONTENT_TYPE KEY: prints the document id and its version id
upload() {
curl -sS --fail-with-body -X POST "$API/api/v2/documents" -H "$AUTH" -H "Idempotency-Key: $3" \
-H "Content-Type: $2" -H "X-Wellfriend-Filename: $(basename "$1")" --data-binary "@$1" \
| jq -r '"\(.document.id) \(.document.currentVersion.id)"'
}
read -r DOCUMENT_ID VERSION_ID < <(upload 'input.html' 'text/html' "$RUN-upload")
# Run web-capture
OP=$(jq -n --arg doc "$DOCUMENT_ID" --arg ver "$VERSION_ID" --arg key "$RUN-1" \
--argjson parameters '{}' \
'{documentId: $doc, versionId: $ver, toolId: "web-capture", parameters: $parameters, idempotencyKey: $key}' \
| curl -sS --fail-with-body -X POST "$API/api/v2/document-operations" -H "$AUTH" \
-H "Content-Type: application/json" -H "Idempotency-Key: $RUN-1" --data-binary @- | jq -r .operation.id)
while :; do
RESULT=$(curl -sS --fail-with-body "$API/api/v2/document-operations/$OP" -H "$AUTH")
STATE=$(echo "$RESULT" | jq -r .operation.state)
case "$STATE" in completed) break ;; failed|cancelled|canceled) echo "$RESULT" >&2; exit 1 ;; esac
sleep 1
done
DOCUMENT_ID=$(echo "$RESULT" | jq -r .operation.outputDocumentId)
VERSION_ID=$(echo "$RESULT" | jq -r .operation.outputVersionId)
# Download the result
curl -sS --fail-with-body "$API/api/v2/documents/$DOCUMENT_ID/versions/$VERSION_ID/content" -H "$AUTH" -o 'input-wellfriend.pdf'Run it with the SDKs
The SDKs upload the file, run web-capture with the same parameters and wait for the result: wf.tools.webCapture() in TypeScript, wf.tools.web_capture() in Python, wf.Tools.WebCapture() in Go.
// wellfriend-document-sdk: npm install wellfriend-document-sdk@latest. An ES module (top-level await): save it as .mts.
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import { Wellfriend } from "wellfriend-document-sdk";
const wf = new Wellfriend({ apiKey: process.env.WELLFRIEND_API_KEY ?? "YOUR_API_KEY" });
const result = await wf.tools.webCapture("input.html");
await result.save("input-wellfriend.pdf");# wellfriend-document-sdk: pip install -U wellfriend-document-sdk
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import os
from wellfriend import Wellfriend
wf = Wellfriend(api_key=os.environ.get("WELLFRIEND_API_KEY", "YOUR_API_KEY"))
result = wf.tools.web_capture("input.html")
result.save("input-wellfriend.pdf")// go get wellfriend.dev/go/wellfriend@latest
package main
import (
"context"
"fmt"
"os"
"wellfriend.dev/go/wellfriend"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run() error {
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
apiKey := os.Getenv("WELLFRIEND_API_KEY")
if apiKey == "" {
apiKey = "YOUR_API_KEY"
}
wf := wellfriend.New(wellfriend.WithAPIKey(apiKey))
ctx := context.Background()
res, err := wf.Tools.WebCapture(ctx, wellfriend.File("input.html"), nil)
if err != nil {
return err
}
return res.Save(ctx, "input-wellfriend.pdf")
}