Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use ChromicPDF to convert a URL to a PDF from Elixir. It drives a local headless Chrome or Chromium process, accepts a URL (or HTML), and can write the result directly to a file:

ChromicPDF.print_to_pdf({:url, "https://example.net"}, output: "example.pdf")

For a production application, add ChromicPDF as a runtime dependency, install a compatible Chrome/Chromium executable, and start ChromicPDF under your supervision tree. The sections below show the complete setup, layout controls, failure fixes, and a hosted alternative when you do not want to operate a browser.

What you need before converting a page

  • An Elixir application using Mix.
  • ChromicPDF (the readme documents a Mix constraint of ~> 1.17; confirm the current release and compatible Elixir/OTP versions before pinning it).
  • Chrome or Chromium installed in the runtime environment. ChromicPDF controls this browser through headless Chrome.
  • Permission for the application process to launch the browser and write the destination PDF.

Ghostscript is optional. ChromicPDF documents it for PDF/A conversion and for concatenating multiple sources; it is not required for a normal single-page URL conversion.

Install ChromicPDF and start its browser process

Add the dependency

In mix.exs, add ChromicPDF to the dependencies that are available at runtime:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs
defp deps do
  [
    {:chromic_pdf, "~> 1.17"}
  ]
end

Fetch it with:

mix deps.get

The exact latest version and its browser requirements can change, so check the ChromicPDF v1.17.1 readme and package metadata when creating a new project.

Add ChromicPDF to the supervision tree

The readme instructs applications to start ChromicPDF as a child. In a standard OTP application, add it to children in application.ex:

def start(_type, _args) do
  children = [
    # Other supervised processes...
    ChromicPDF
  ]

  opts = [strategy: :one_for_one, name: MyApp.Supervisor]
  Supervisor.start_link(children, opts)
end

Use your project’s existing supervisor name and other children; the important part is that the ChromicPDF process is supervised before your code calls it.

Install and verify Chrome or Chromium

Install the browser using the package manager or base image appropriate for your operating system, then verify that the executable can run in the same container or VM as the BEAM application. A deployment image that has Elixir but no browser will fail even though compilation succeeds. The tested configurations listed in the readme include old combinations such as Elixir 1.15.7 with OTP 26.2 and Chromium 119, and Elixir 1.14.0 with OTP 25.1 and Chromium 90. Those rows document historical test environments, not a current compatibility guarantee. Test your exact Elixir, OTP, browser, OS image, and (if used) Ghostscript combination.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Convert a URL to a PDF file

Minimal Elixir call

Once the application is running, pass a URL source tuple and an output path:

ChromicPDF.print_to_pdf(
  {:url, "https://example.net"},
  output: "example.pdf"
)

The call asks the browser to load the external page and writes the generated PDF to example.pdf. Use an absolute destination path when the working directory can vary between development, a release, and a container.

Wrap conversion in your own function

A small module keeps URL validation, destination handling, and error reporting out of controllers or jobs:

defmodule MyApp.WebPdf do
  @spec from_url(String.t(), Path.t()) :: :ok | {:error, term()}
  def from_url(url, output_path) when is_binary(url) and is_binary(output_path) do
    ChromicPDF.print_to_pdf({:url, url}, output: output_path)
  end
end

Call it from a supervised task, background job, or controller action rather than blocking a web request indefinitely. Check the returned value and confirm that the file exists before you upload or serve it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Generate a PDF from HTML instead of a URL

ChromicPDF also accepts HTML strings as sources. This is useful when Elixir renders a template, combines fragments, or needs a self-contained document instead of fetching a public page.

html = """
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <style>
      @page { size: A4; margin: 18mm; }
      body { font-family: sans-serif; }
    </style>
  </head>
  <body>
    <h1>Invoice</h1>
    <p>Generated by MyApp</p>
  </body>
</html>
"""

ChromicPDF.print_to_pdf({:html, html}, output: "invoice.pdf")

Keep external CSS, fonts, images, and scripts reachable from the browser. For reproducible output, prefer absolute asset URLs or embed the assets and ensure the process has network access when the document is rendered.

Rank #2
Sale
Epson EcoTank Photo ET-8550 Wireless Wide-Format All-in-One Tank Printer
  • CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
  • INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
  • PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
  • ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴

Concatenate several sources

The documentation demonstrates concatenating multiple HTML sources. Use that capability when a report consists of separate sections, and install Ghostscript if your chosen workflow requires the documented concatenation or PDF/A features. Confirm the current API shape in the version you install rather than copying an example from an older release unchanged.

Control paper size, margins, and print appearance

Page dimensions

ChromicPDF’s template API includes page-dimension controls; the readme shows size: :a4. Use the template/options API documented for your installed version to select A4 or another supported paper size, then set margins, headers, and footers as needed. Do not assume a screen viewport is the same as the printed page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Print CSS is the default browser model

Browser PDF generation follows print media by default. The Puppeteer Page.pdf API documents that Page.pdf() uses the print CSS media type. Print-specific rules therefore affect visibility, colors, and layout:

@media print {
  .navigation, .cookie-banner { display: none; }
  a { color: #000; text-decoration: none; }
}

If you need the screen stylesheet instead, Puppeteer documents emulating screen media before creating the PDF. Whether and how that low-level control is exposed by your ChromicPDF version must be checked in its current API documentation. To preserve background colors when supported by the browser, use the CSS property -webkit-print-color-adjust: exact, while understanding that printer settings and browser behavior can still affect the result.

Fonts and late-loading assets

PDF fidelity depends on what the target page has loaded: fonts, images, stylesheets, and JavaScript-rendered content. Puppeteer’s PDF guide states that its Page.pdf() waits for fonts by default; that statement describes Puppeteer’s API and is not proof that every Elixir integration waits identically. If a PDF has missing text or blank image boxes, make the page load deterministically, host assets reliably, and use the readiness controls available in your ChromicPDF release.

Handle output for uploads and HTTP responses

ChromicPDF documents two output patterns: write directly to a named path, or provide a callback that receives the generated PDF as a temporary-file path. The callback approach is useful when you need to upload to object storage, stream the file to another service, or delete temporary files after processing. Keep the callback short and move slow uploads to a supervised job so browser workers are not held longer than necessary.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common failures and fixes

“Chrome/Chromium executable not found”

Cause: The runtime image lacks a browser, or the executable path is not visible to the application user.

Fix: Install Chrome/Chromium in the same image or VM, verify it can launch under the service account, and follow the executable configuration documented by your ChromicPDF version.

The application crashes during startup

Cause: ChromicPDF was not started under the supervision tree, or its dependency was not fetched in the release.

Fix: Add ChromicPDF to the application’s children, run mix deps.get, and rebuild the release with runtime dependencies included.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.

The PDF is blank or missing dynamic content

Cause: The page failed to load, JavaScript has not finished, or required assets are blocked by authentication, network policy, or certificate errors.

Fix: Open the URL from the same deployment environment, inspect browser logs, make authentication and outbound access explicit, and use the library’s documented waiting/readiness options where available. Do not treat a successful file write as proof that the page rendered correctly.

Layout differs from the browser screen

Cause: PDF output uses print media and print pagination, not an unconstrained screen viewport.

Fix: Add @media print rules, set page size and margins, avoid fixed elements that overlap page breaks, and test long tables and images across multiple pages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Images or fonts are missing

Cause: Relative URLs resolve differently, assets are private, or the browser exits before resources are ready.

Fix: Use reachable absolute URLs or inline assets, provide the required authentication through your application’s page-loading setup, and test from the production container rather than only from a laptop.

Conversion is too slow or unreliable under load

Cause: Each job depends on a real browser, while pages may execute heavy JavaScript or wait on third-party resources.

Fix: Queue conversions, cap concurrency, set job timeouts, cache documents when content is unchanged, and monitor browser-process memory. The cited documentation does not provide a benchmark or a reliability comparison, so measure your own URLs and deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a hosted screenshot/PDF API is a better fit

Running Chromium alongside the BEAM application gives you control, but it also makes browser installation, patching, scaling, and network access your responsibility. A hosted service can be preferable for bursty workloads, multiple deployment environments, or teams that do not want browser dependencies in an Elixir release.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Its URL endpoint returns PNG, JPEG, WebP, or PDF, so an Elixir service can call it over HTTPS instead of supervising Chromium locally. Before capture it accepts the cookie/consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response reports the page verdict and billing result in X-Page-Verdict and X-Billed headers.

For a PDF response, make one GET request (adapt the URL and options to your page):

Rank #4
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://example.net 
  -o page.pdf

See the ScreenshotNeo documentation for output and capture parameters. It supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper size/margins/landscape/page ranges, HTML/CSS input, custom JavaScript and CSS, clicks, selector or network-idle waits, ad/tracker/request blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Calling it from Python or Node.js

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.net"}, timeout=90)
r.raise_for_status()
open("page.pdf", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.net' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());

ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account.

Choosing between ChromicPDF and a hosted API

Requirement ChromicPDF in your Elixir app ScreenshotNeo
Infrastructure You install and supervise Chrome/Chromium. Call an HTTPS endpoint; no local browser process.
Input URL or HTML strings, including composed sources. URL, with extensive capture and PDF options.
Data path Named file or documented temporary-file callback. HTTP response, with verdict and billing headers.
Special PDF workflows Optional Ghostscript for documented PDF/A and concatenation. PDF paper size, margins, landscape, and page ranges through API options.
Pricing model Your browser and compute costs. Free 1,000 shots/month; paid plans from $5 for 3,000 shots.

No source cited here establishes that either approach is universally faster or more reliable. Benchmark representative pages, asset sizes, concurrency, and failure recovery in your own environment.

FAQ

Can ChromicPDF convert a private page?

It can load whatever the browser process can access, but the documented material does not specify a universal authentication mechanism. Design authentication and network access explicitly, then test from the deployment environment.

Does converting a URL require Ghostscript?

No. Ghostscript is optional for the documented PDF/A conversion and concatenation workflows; a normal URL-to-PDF call requires Chrome or Chromium.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I rely on the old ChromicPDF test matrix for a new release?

No. The listed Elixir, OTP, Chromium, and Ghostscript versions are historical tested configurations. Validate the versions you will actually deploy.

Frequently Asked Questions

Can ChromicPDF convert a private page?

It can load whatever the browser process can access, but the documented material does not specify a universal authentication mechanism. Design authentication and network access explicitly, then test from the deployment environment.

Does converting a URL require Ghostscript?

No. Ghostscript is optional for the documented PDF/A conversion and concatenation workflows; a normal URL-to-PDF call requires Chrome or Chromium.

Can I rely on the old ChromicPDF test matrix for a new release?

No. The listed Elixir, OTP, Chromium, and Ghostscript versions are historical tested configurations. Validate the versions you will actually deploy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.