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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

There are two different jobs people call a “full-page PDF” in Ruby: generating a paginated PDF from content your Ruby code owns, or converting an existing HTML page or website into a PDF. Use Prawn for the first. For HTML or a URL, use a browser-based renderer such as Grover or Ferrum. A full-page screenshot setting is not a substitute for PDF page sizing and pagination.

Choose the right kind of full-page PDF

Start with the source of the content, not the word “full-page.” A Ruby-authored report and a long webpage need different rendering approaches.

What you have Suitable route What controls the result
Text, tables, graphics, or images assembled by Ruby Prawn Ruby code defines layout and page flow.
An existing HTML document, Rails view, or website URL Grover or Ferrum with Chromium The browser renders HTML/CSS; PDF print settings define paper geometry.

Prawn’s maintainers explicitly say it is not an HTML-to-PDF generator. If you already have a carefully styled HTML page, using Prawn means recreating its design with Prawn’s own layout tools. For faithful browser-style rendering, use a browser-based route instead.

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

Generate a paginated PDF from Ruby content with Prawn

Prawn is a pure Ruby PDF-generation library. Its documented capabilities include text layout, vector drawing, image embedding, page numbers, repeatable content, fonts, and PDF security features. It is a good fit when the application owns the document structure and you want explicit control over its PDF layout.

#1 Best Overall

Install and generate a simple document

Add the gem to your application, then run bundle install:

gem "prawn"

A minimal standalone example, following Prawn’s documented API, is:

require "prawn"

Prawn::Document.generate("report.pdf", page_size: "A4", page_layout: :portrait) do
  text "Report title"
  text "Add the document content here. Prawn lays out the authored content in the PDF."
end

Run the Ruby file in the application environment where Prawn is installed. The output is report.pdf in the process’s current working directory. In a web application, choose an output path or response mechanism appropriate to your framework rather than assuming the process directory is writable.

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

Set paper size and orientation deliberately

Prawn documents standard page sizes and custom dimensions. Its API examples include A4, landscape orientation, and a custom two-number page size such as [200, 300], measured in PDF points. The documented default is US Letter portrait. Choose the dimensions for the intended reader and use—printing standards vary by locale, while a screen-first report may need a different layout than a document intended for filing or printing.

For example, change the options in the generator to use landscape orientation:

Prawn::Document.generate("report.pdf", page_size: "A4", page_layout: :landscape) do
  text "Wide report"
end

“Full-page” does not mean one extremely tall sheet. A conventional PDF uses one or more paper-sized pages, with content flowing across them. Select the size and orientation, then structure and lay out the content so that it remains readable and printable.

Convert HTML or a webpage to PDF with Ruby

For an existing HTML page, use a browser engine so its HTML and CSS are rendered before PDF output. Grover wraps Puppeteer and Chromium and documents rendering HTML or a URL. Ferrum provides browser automation APIs, including a page PDF method. Both paths involve a browser runtime, unlike Prawn’s Ruby-authored layout model.

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

Use Grover when you want Puppeteer-based rendering

Grover documents PDF layout configuration and controls for media emulation, navigation readiness, selector or function waits, timeouts, and local or remote Chromium configuration. A basic URL-to-PDF flow looks like this; the exact initialization and option names should be checked against the Grover release installed in your application:

require "grover"

pdf = Grover.new(
  "https://example.com",
  format: "A4",
  wait_until: "networkidle0",
  timeout: 60_000
).to_pdf

File.binwrite("page.pdf", pdf)

Grover’s README documents these categories of controls, but readiness settings are not universal guarantees. A site can keep network activity open, load content after a particular interaction, or depend on a specific selector. Choose the wait behavior based on the page you actually need to print, and verify the generated PDF.

Use Ferrum when working directly with its browser page API

Ferrum’s page API exposes PDF creation with standard or explicit paper dimensions. The project also documents full-page screenshots; that setting applies to screenshot capture, not PDF page layout. For PDF output, call the PDF method and configure its paper dimensions or other documented print options for the Ferrum version in your application.

Because the exact options and runtime configuration depend on the installed Ferrum release and Chromium environment, consult the project’s API documentation before copying a particular option set into production. Treat PDF generation and full-page screenshot capture as separate operations: a screenshot has pixel dimensions, while a PDF is paginated according to print geometry.

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

Get the whole page into the PDF

A browser can only print content that has rendered by the time PDF conversion begins. A navigation-complete event may happen before a client-side application finishes drawing its main content, before a lazy image enters the viewport, or before a late API response updates the page.

  • Wait for a meaningful selector when the page has a stable element that signals the content is present.
  • Use a function wait when a specific application state is the best readiness signal.
  • Use a navigation readiness condition or delay only when it matches the page’s behavior; a delay alone is brittle if load times vary.
  • Set a timeout that allows for the page’s expected work, while still failing rather than hanging indefinitely.
  • Open or inspect the resulting PDF and confirm that below-the-fold content, images, and dynamically rendered sections are present.

Grover documents wait_until, wait_for_selector, wait_for_function, and timeouts. No single setting ensures readiness on every site; pick and validate the condition for the page being rendered.

PDF page size is not full-page screenshot size

Ferrum’s screenshot API has a full option for a full-page screenshot. Its implementation derives screenshot dimensions from the document’s scroll width and height and captures beyond the viewport. That creates an image, not a print-ready, multi-page PDF layout.

For a PDF, configure paper dimensions and printing behavior instead. A long webpage may flow across several paper-sized pages, and its layout can differ from the browser viewport because print rendering is a distinct output mode. If the goal is one tall image rather than printable pages, use a full-page screenshot workflow and save an image; do not expect the screenshot flag to configure PDF pagination.

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

Common problems and fixes

The PDF contains only Ruby-created content, not my HTML

This is expected if you chose Prawn: it generates PDFs from Ruby layout code rather than rendering HTML. Use Grover or Ferrum for browser-rendered HTML, or rebuild the document using Prawn primitives if you want Ruby to own the complete layout.

Content below the fold is missing

Check whether the browser finished rendering the relevant content before PDF conversion. Add a wait for the page’s actual content selector or state, and inspect whether the page loads sections only after scrolling or interaction. A full-page screenshot flag is not a remedy for a PDF created before content is ready.

The PDF looks different from the webpage

Check the print dimensions, orientation, and browser print rendering settings. A viewport is measured in pixels; PDF pages use paper geometry. Ensure the paper size suits the content and inspect the generated document at its intended screen or print size.

Browser-based generation times out or cannot launch

Unlike Prawn, Grover and Ferrum depend on a Chromium-based browser setup. Confirm that the Chromium configuration is available to the application and that the chosen navigation or wait condition can complete for this page. Grover documents local and remote Chromium configuration as well as timeout and readiness controls; use the documentation for the installed version to diagnose environment-specific setup.

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.

Images or scripts are absent

The browser may have started PDF conversion before those assets or client-side updates completed, or the page may require a condition beyond initial navigation. Wait for a meaningful selector or function, then generate and inspect the PDF again. A fixed delay can help diagnose timing, but a page-specific readiness condition is generally more dependable.

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

Performance, reliability, and cost considerations

Prawn avoids a browser-rendering step because it creates the PDF from Ruby layout code. Grover and Ferrum render through Chromium, which introduces browser setup and page-readiness considerations but lets the output follow browser-rendered HTML and CSS. The reviewed project documentation does not establish comparative speed, hosting cost, or reliability figures, so choose based on input format and validate the behavior in your deployment environment.

For a small, controlled report, a single Prawn generation call is direct. For HTML pages with JavaScript or external assets, budget for browser configuration and test the exact page under realistic runtime conditions. In either case, generate a representative PDF and check page breaks, clipping, orientation, and content completeness before relying on it for users.

Or skip the browser setup

If the source is a live webpage and you do not want to configure Chromium, ScreenshotNeo offers a one-request screenshot or PDF API. For a PDF, use the documented PDF format parameter in the ScreenshotNeo API documentation. For example, the base call for a web capture is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://stripe.com 
  -o shot.webp

ScreenshotNeo removes cookie or consent banners, newsletter popups, and chat widgets before capture; those steps can each be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing outcome in headers. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

Which Ruby PDF approach should you use?

  • Choose Prawn when Ruby code is the source of truth and you want to control document layout directly.
  • Choose Grover or Ferrum when the input is HTML, a Rails view, or a website and browser rendering is the intended output.
  • For browser-rendered PDFs, configure paper geometry separately from screenshot dimensions and wait for the page-specific content you need.

Frequently Asked Questions

Does Prawn convert a URL or HTML page directly to PDF?

No. Prawn’s maintainers describe it as a PDF-generation library, not an HTML-to-PDF generator.

What does “full-page” mean for a PDF?

Usually it means the document includes all relevant content across one or more paper-sized pages, not one infinitely tall page.

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.

Does Ferrum’s full-page screenshot option make a full-page PDF?

No. The full-page option applies to screenshot capture. PDF output uses its own paper dimensions and print settings.

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.