What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use a real browser renderer when your HTML depends on modern CSS or JavaScript; use a wkhtmltopdf wrapper when your Rails application already fits that engine. In Ruby, the practical choices are Grover (Puppeteer and Chromium), Wicked PDF (Rails plus wkhtmltopdf), and PDFKit (Ruby plus wkhtmltopdf). The renderer must be able to reach every stylesheet, image, font, and script, and untrusted HTML must be sanitized and prevented from reaching internal network addresses.
Choose the rendering path first
| Option | Renderer and input | Best fit | Important constraint |
|---|---|---|---|
| Grover | Puppeteer with Chromium; URL or inline HTML | Modern browser behavior, JavaScript-dependent pages, Rails templates rendered to strings | Chromium and its deployment dependencies must be available |
| Wicked PDF | Rails integration that invokes wkhtmltopdf | Rails responses and applications already standardized on wkhtmltopdf | Assets need absolute URLs or Wicked PDF asset helpers |
| PDFKit | Ruby interface to wkhtmltopdf; HTML, URL, or file | Direct conversion from Ruby code or a file/URL | Raw HTML should use a complete file path or a URL containing its domain |
Documentation does not establish a universal winner for speed, fidelity, compatibility, or cost. Test your own templates, Ruby and Rails versions, operating system, renderer packaging, and deployment limits before committing.
Prepare HTML that a PDF renderer can actually load
Make every asset addressable
A renderer is a separate process. A browser can resolve /assets/app.css because it knows your development host; a converter given an HTML string may not. Use absolute HTTPS URLs, absolute filesystem paths where supported, or a renderer display/base URL. Grover defaults relative resolution to http://example.com when no display URL is supplied, so set an appropriate display_url or rewrite links. Wicked PDF’s documentation likewise requires absolute CSS, JavaScript, and image references or its asset helpers. PDFKit recommends complete file paths or domain-qualified URLs for raw HTML.
Render Rails views first
For a Rails view, generate a complete document with render_to_string, including the stylesheet and data needed for a standalone page. Avoid relying on request-only state that will not exist in the converter process. Include print-specific rules in the document or stylesheet.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Control print styling
Puppeteer’s page.pdf() uses the print CSS media type. If the screen layout is the intended design, call page.emulateMediaType('screen') before generating the PDF. Browser PDF output can also modify colors for printing; -webkit-print-color-adjust: exact asks Chromium to preserve specified colors.
@media print {
.no-print { display: none !important; }
.page-break { break-before: page; }
}
html { -webkit-print-color-adjust: exact; }
Grover with Puppeteer and Chromium
Grover accepts either a URL or inline HTML and exposes PDF generation through to_pdf. A minimal conversion is:
require "grover"
html = "<html><body><h1>Invoice</h1></body></html>"
pdf = Grover.new(html, format: "A4").to_pdf
File.binwrite("invoice.pdf", pdf)
When HTML is a URL, pass that URL instead of the string. For inline HTML containing relative links, provide a display URL that represents the host from which assets should resolve.
require "grover"
html = File.read("app/views/invoices/show.html.erb")
# The display URL gives Chromium a base for relative assets.
pdf = Grover.new(
html,
format: "A4",
display_url: "https://example.com/invoices/preview"
).to_pdf
File.binwrite("invoice.pdf", pdf)
Rails controller pattern
class InvoicesController < ApplicationController
def show
@invoice = Invoice.find(params[:id])
html = render_to_string(
template: "invoices/show",
formats: [:html],
layout: "pdf",
locals: { invoice: @invoice }
)
pdf = Grover.new(
html,
format: "A4",
display_url: invoice_url(@invoice, host: "example.com")
).to_pdf
send_data pdf,
filename: "invoice-#{@invoice.id}.pdf",
type: "application/pdf",
disposition: "inline"
end
end
Ensure the layout emits absolute asset URLs and that fonts are reachable from the worker. If your page populates content asynchronously, wait for the relevant selector or otherwise ensure the HTML is complete before calling to_pdf; the exact option names depend on the Grover release you install, so verify them against that release’s documentation.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Wicked PDF in Rails
Wicked PDF invokes the wkhtmltopdf executable and can render a Rails response directly:
def show
@invoice = Invoice.find(params[:id])
render pdf: "invoice-#{@invoice.id}"
end
The generated response is converted outside the Rails process. Use Wicked PDF’s asset helpers or absolute URLs for CSS, images, and JavaScript. A relative path that works in the normal HTML response can fail in the PDF job. Verify the wkhtmltopdf binary is installed and available to the application user in every environment, including production workers.
Security boundary
Do not pass arbitrary user HTML directly to wkhtmltopdf. Sanitize user-generated HTML and CSS, and restrict requests to internal IP addresses and hostnames. This protects the conversion process from being used to retrieve services that should not be exposed to it. Apply the same principle to images, stylesheets, scripts, and redirects embedded in submitted content.
PDFKit for direct Ruby conversion
PDFKit is another Ruby interface to wkhtmltopdf. It accepts HTML, a URL, or a file. Supply a domain-qualified URL or complete file path when converting raw HTML:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
require "pdfkit"
html = File.read("public/invoice.html")
kit = PDFKit.new(html, page_size: "A4")
File.binwrite("invoice.pdf", kit.to_pdf)
For a URL:
require "pdfkit"
kit = PDFKit.new("https://example.com/invoices/42", page_size: "A4")
File.binwrite("invoice.pdf", kit.to_pdf)
Because PDFKit and Wicked PDF both rely on wkhtmltopdf, they share its deployment and asset-loading considerations. Their integration model differs: Wicked PDF is oriented around Rails response rendering, while PDFKit is convenient when your Ruby code already has a URL, file, or HTML string.
Paper size, margins, and page behavior
Start with the output contract: paper size (for example, A4), orientation, margins, headers and footers, page ranges, and whether background colors are required. Keep content inside printable margins and use CSS page-break rules for invoices, reports, and chapters. Test long tables, images near page boundaries, web fonts, and pages with no data. A PDF that looks correct on a short fixture can break when a table spans several pages.
Security and reliability checklist
- Sanitize all user-supplied HTML and CSS.
- Block access to internal IP addresses and hostnames when converting untrusted content.
- Use a dedicated worker or sandbox for conversion and enforce timeouts.
- Allowlist external asset hosts where practical; avoid secrets in URLs.
- Log renderer exit failures and retain the input identifier so a failed document can be reproduced safely.
- Check that every font, image, stylesheet, and script is reachable from the converter’s network namespace.
Troubleshooting common failures
The PDF is unstyled
Inspect the generated HTML and replace relative asset paths with absolute URLs, complete file paths, or a Grover display URL. Confirm the converter process can resolve the host and authenticate if assets are protected.
Images or fonts are missing
Check HTTP status codes, redirects, certificate trust, and file permissions from the renderer’s environment—not just from your laptop browser. Inline critical assets only when size and security constraints permit.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
JavaScript content is absent
Use a Chromium-based path such as Grover for browser-dependent content, and ensure the page has finished its asynchronous work before PDF generation. A wkhtmltopdf wrapper may not reproduce modern browser behavior.
Colors differ from the screen
Remember that Puppeteer prints with print media by default. Choose print rules deliberately, or emulate screen media, and use -webkit-print-color-adjust: exact when preserving specified colors is important.
Conversion hangs or fails only in production
Compare the production worker’s executable path, Chromium/wkhtmltopdf installation, sandbox permissions, DNS, outbound firewall rules, and available memory. Add a bounded timeout and return a clear retryable error rather than holding a web request indefinitely.
User content triggers a security concern
Stop conversion, sanitize the source, and enforce outbound network restrictions. Never treat a PDF endpoint as a safe place to execute arbitrary HTML, CSS, or JavaScript.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Or skip the browser setup
If you only need a hosted capture of a URL or PDF rather than maintaining Chromium or wkhtmltopdf, ScreenshotNeo provides a GET endpoint and can capture a PDF. It accepts cookie/consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo documentation for PDF parameters and the other capture options. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
Frequently Asked Questions
Should I use Grover or a wkhtmltopdf wrapper?
Choose Grover when Chromium behavior, modern CSS, or JavaScript-dependent content matters. Choose Wicked PDF or PDFKit when your application is already built around wkhtmltopdf and its output meets your templates.
Can I convert a Rails form submission to a PDF?
Validate and authorize the submitted data, render a complete HTML view with those values, then pass that HTML to Grover or a wkhtmltopdf integration. Sanitize any user-provided markup rather than treating form fields as trusted HTML.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Why does a relative image URL work in HTML but not PDF?
The converter runs separately and may have no browser request context. Give it absolute URLs, complete file paths, or a configured base/display URL and verify network access from the conversion process.
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.

