Skip to content
shotsmith
Features Docs Guides Pricing Changelog Sign inStart free

Convert a website to PDF

Turn any web page into a printable PDF, with backgrounds and images, in A4 or US Letter. Cookie banners and ads are removed first so they don’t end up on the page.

Enter an address and press Make PDF.

Free for 10 captures a day, no sign-up. Pages are rendered in real Chrome on our servers and not stored.

Do this from your own code

This tool is the shotsmith API with a form in front. The same request from your app, with a free key (100 renders a month):

// npm install @shotsmith/sdk
import { Shotsmith, TakeOptions } from '@shotsmith/sdk';
import { writeFile } from 'node:fs/promises';

const shotsmith = new Shotsmith({
  accessKey: 'YOUR_ACCESS_KEY',
});

const options = TakeOptions.url('https://example.com')
  .format('pdf')
  .pdfPaperFormat('a4')
  .pdfPrintBackground()
  .blockCookieBanners();

await writeFile('capture.pdf', await shotsmith.take(options));
<?php

// composer require shotsmith/shotsmith-php
require 'vendor/autoload.php';

use Shotsmith\Client;
use Shotsmith\Options\TakeOptions;

$shotsmith = new Client('YOUR_ACCESS_KEY');

$options = TakeOptions::url('https://example.com')
    ->format('pdf')
    ->pdfPaperFormat('a4')
    ->pdfPrintBackground()
    ->blockCookieBanners();

file_put_contents('capture.pdf', $shotsmith->take($options));

// In Laravel: Shotsmith::take($options) with SHOTSMITH_ACCESS_KEY in .env
curl -G "https://shotsmith.dev/v1/take" \
  --data-urlencode "access_key=YOUR_ACCESS_KEY" \
  --data-urlencode "url=https://example.com" \
  --data-urlencode "format=pdf" \
  --data-urlencode "pdf_paper_format=a4" \
  --data-urlencode "pdf_print_background=true" \
  --data-urlencode "block_cookie_banners=true" \
  -o capture.pdf
import { writeFile } from 'node:fs/promises';

const params = new URLSearchParams({
  access_key: 'YOUR_ACCESS_KEY',
  url: 'https://example.com',
  format: 'pdf',
  pdf_paper_format: 'a4',
  pdf_print_background: 'true',
  block_cookie_banners: 'true',
});

const res = await fetch(`https://shotsmith.dev/v1/take?${params}`);
if (!res.ok) throw new Error((await res.json()).error_message);

await writeFile('capture.pdf', Buffer.from(await res.arrayBuffer()));
import urllib.request
from urllib.parse import urlencode

params = {
    "access_key": "YOUR_ACCESS_KEY",
    "url": "https://example.com",
    "format": "pdf",
    "pdf_paper_format": "a4",
    "pdf_print_background": "true",
    "block_cookie_banners": "true"
}

url = "https://shotsmith.dev/v1/take?" + urlencode(params, doseq=True)

# Raises urllib.error.HTTPError on a 4xx/5xx response
with urllib.request.urlopen(url, timeout=120) as res, open("capture.pdf", "wb") as f:
    f.write(res.read())
<?php

$query = http_build_query([
    'access_key' => 'YOUR_ACCESS_KEY',
    'url' => 'https://example.com',
    'format' => 'pdf',
    'pdf_paper_format' => 'a4',
    'pdf_print_background' => 'true',
    'block_cookie_banners' => 'true',
], '', '&', PHP_QUERY_RFC3986);

$ch = curl_init('https://shotsmith.dev/v1/take?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($status !== 200) {
    throw new RuntimeException(json_decode($body, true)['error_message'] ?? "HTTP {$status}");
}

file_put_contents('capture.pdf', $body);
package main

import (
	"io"
	"net/http"
	"os"
)

func main() {
	res, err := http.Get("https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fexample.com&format=pdf&pdf_paper_format=a4&pdf_print_background=true&block_cookie_banners=true")
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	if res.StatusCode != http.StatusOK {
		body, _ := io.ReadAll(res.Body)
		panic(string(body))
	}

	out, err := os.Create("capture.pdf")
	if err != nil {
		panic(err)
	}
	defer out.Close()
	io.Copy(out, res.Body)
}
require "net/http"
require "uri"

uri = URI("https://shotsmith.dev/v1/take")
uri.query = URI.encode_www_form([
  ["access_key", "YOUR_ACCESS_KEY"],
  ["url", "https://example.com"],
  ["format", "pdf"],
  ["pdf_paper_format", "a4"],
  ["pdf_print_background", "true"],
  ["block_cookie_banners", "true"]
])

res = Net::HTTP.get_response(uri)
raise res.body unless res.is_a?(Net::HTTPSuccess)

File.binwrite("capture.pdf", res.body)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

public class Capture {
    public static void main(String[] args) throws Exception {
        var client = HttpClient.newHttpClient();
        var request = HttpRequest.newBuilder(URI.create(
            "https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fexample.com&format=pdf&pdf_paper_format=a4&pdf_print_background=true&block_cookie_banners=true"
        )).build();

        var res = client.send(request, HttpResponse.BodyHandlers.ofFile(Path.of("capture.pdf")));
        if (res.statusCode() != 200) {
            throw new RuntimeException("HTTP " + res.statusCode());
        }
    }
}
using System;
using System.IO;
using System.Net.Http;

using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(120) };

// Throws HttpRequestException on a 4xx/5xx response
var bytes = await http.GetByteArrayAsync(
    "https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fexample.com&format=pdf&pdf_paper_format=a4&pdf_print_background=true&block_cookie_banners=true"
);

await File.WriteAllBytesAsync("capture.pdf", bytes);

Questions

Is it free?

Yes, 10 PDFs a day without an account. A free account gives you 100 a month through the API.

Why does the PDF look different from the website?

PDFs use the site’s print styles, which many sites set up to hide menus and adverts. Through the API you can switch to the screen styles with media_type=screen, or fit the whole page on one sheet.

Can I convert my own HTML to PDF, such as invoices?

Yes, through the API: send the HTML instead of a URL. Our guide on invoices and receipts shows how.

Are the PDFs stored?

No. The free tool returns the PDF straight to your browser and doesn’t keep it.

More free tools