A shipment tracking page has to become a PDF, filed by a Go service as proof of delivery. One route drives a browser, and in Go that browser can be controlled by chromedp, an MIT-licensed module that speaks the Chrome DevTools Protocol with no external driver.

Our IronPDF for Go is coming soon, with early-access sign-up. The chromedp print path comes first here, then the parts of that path that fall to the service team, and then what the Go edition is designed to put in its place.

We work at Iron Software, and the end of this article covers our library, IronPDF.

How does chromedp print a page to PDF after v0.19.0?

It navigates to the page and then runs one PrintToPDF action, which returns the file as a byte slice. That action arrived in v0.19.0, released on October 4, 2026, on top of the generic API from v0.17.0, in which chromedp.Run takes one action and returns its value along with an error, while chromedp.Do runs actions that return nothing. Three names belong to the earlier API, page.PrintToPDF().Do(ctx), chromedp.ActionFunc and chromedp.Tasks, so a snippet that contains any of them predates the generic API.

The listing below prints the tracking page on A4 paper with custom margins and backgrounds.

// The first action run on this context starts the browser, and cancel stops it. ctx, cancel := chromedp.NewContext(context.Background()) defer cancel() url := "https://track.example.com/shipments/48213" if err := chromedp.Do(ctx, chromedp.Navigate(url)); err != nil { return err } // Since v0.17.0, Run takes one action and returns its value with the error. buf, err := chromedp.Run(ctx, chromedp.PrintToPDF( chromedp.PDFPaper(chromedp.PaperA4), chromedp.PDFMargins(0.9, 0.6, 0.9, 0.6), chromedp.PDFPrintBackground(), )) if err != nil { return err } return os.WriteFile("delivery-proof-48213.pdf", buf, 0o644) 

With no options, PrintToPDF produces Letter paper in portrait, 1 cm margins, no header or footer and no backgrounds. Letter paper and missing backgrounds come from the browser's own print behavior, so a tracking page with a colored status banner loses its color until the call asks for backgrounds.

Where does the browser come from in a container?

It has to be installed in the image, because chromedp drives a browser that must already exist on the host. On Unix-like systems the package searches at start-up for an executable by name, beginning with headless_shell and headless-shell, moving on to chromium, google-chrome and their variants, and falling back to the name google-chrome when nothing turns up. A machine that already has Chrome or Chromium installed passes that search. A bare container image fails it until a browser is added.

The project publishes a chromedp/headless-shell container image, a slimmed-down Chrome built to support the package, and the documented route for headless environments is to run the Go program inside it. The package also sets container-friendly defaults. It sends shared memory to the temp directory, because /dev/shm is small in many containers, and it adds --no-sandbox when the process runs as root unless that default is turned off.

Each of those settings is a decision the service team makes about a browser, and the shared-memory default trades away some speed and can let memory grow.

Who looks after the Chrome process once it runs?

The service does, under rules that the project's FAQ spells out. The first Run on a context starts the browser and ties its life to that context. A timeout on that context stops the browser when it expires, so the working pattern is a long-lived parent context with no timeout and a derived, timed context for each print. Concurrent requests follow the same shape, with one parent browser context and a child per goroutine.

When the connection to the browser drops, chromedp cancels the context and the caller sees context canceled. That happens when the browser is closed or its process is killed, and if the process died on its own, the error includes its exit error. A browser that never comes up reports chrome failed to start: followed by Chrome's own output. In containers, the headless-shell image should run with --init so that zombie processes are reaped.

The print options and automation chromedp offers

The print options in chromedp go well past the listing above, with header and footer templates, page ranges, scale, CSS page size, tagged output for screen readers and a streaming mode in which the browser sends a large file in pieces. The same package handles clicks, waits and screenshots when a page needs interaction before it prints, and the project's migration document lists every renamed and removed name.

What does IronPDF for Go put in place of the browser?

An in-process engine, by design. According to the IronPDF for Go page, the edition will run IronPDF Universal, the IronPDF engine rebuilt as WebAssembly, inside the application itself, with no server, no remote call and nothing extra to deploy next to the app. The engine is designed to run in a Wasmtime sandbox, with one pair of modules for every operating system and architecture, and the page says one package update will deliver a security patch.

For the tracking page, a design with nothing extra to deploy would leave no Chrome binary to add to the image. The page lists HTML conversion from strings, files and URLs, with HTML, CSS and JavaScript rendered to PDF. Beyond conversion, it lists document assembly, page edits such as headers, footers, watermarks and bookmarks, forms and digital signatures, extraction and comparison, and security work such as passwords, redaction, compression and PDF/A.

Where should a Go service start the move?

Start with a list of every endpoint that prints a web page to PDF in Go, and mark the ones where Chrome exists only to print. Those endpoints are the first candidates for the Go edition, because they gain the most when the browser leaves the image.

  1. Pick the hardest page: choose the tracking page with the colored status banner, its scripts and its web fonts, and keep a reference PDF from the current endpoint.
  2. Stabilize the current endpoint: remove any timeout from the context that starts the browser, move timeouts to per-print child contexts, and run the container with --init.
  3. Sign up for early access: register the team so the reference page can be rendered with IronPDF for Go as soon as a build is available, then compare the two PDFs side by side.
  4. Move endpoint by endpoint: if the reference page matches, point the next print-only endpoint at the Go edition and remove its share of the browser setup.

The chromedp details in this article come from the project's repository, documentation and migration notes. Sign-ups for the Go edition's early access go through the IronPDF for Go page on ironpdf.com, and the first page we would try with it is the one that has given the team the most trouble.

Drafted with AI. On November 26, 2026, the chromedp calls and defaults were checked against the chromedp source at tags v0.20.0 and v0.24.0, its README and its migration notes, the release history against its tags and release notes, and the IronPDF for Go claims against its product page.

chromedp, Chrome, Chromium, Google, Go and Wasmtime are trademarks of their respective owners, we have no affiliation with any of them, and the facts above come from the chromedp repository, its documentation and release notes and the IronPDF for Go page on ironpdf.com.