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.

To generate a full-height PDF in Ruby, render the page first and set the PDF page height from the rendered content instead of relying on normal pagination. The most direct hosted approach is PDFShift’s API: send a JSON request to https://api.pdfshift.io/v3/convert/pdf with format: "1280xauto", then write the binary response to a file. The auto height is calculated from the page content.

What “full-height PDF” means

A full-height PDF is a single PDF page whose height expands to contain the rendered HTML. It is not the same as a conventional multi-page PDF with page-break rules disabled. The result behaves like one continuous canvas: useful for invoices, dashboards, receipts, long web pages and archival captures where splitting content across sheets would be undesirable.

Single-page output has trade-offs. Very tall pages can be awkward to zoom, print or open in some viewers. If readers need paper output, selectable sections, predictable pagination or strong accessibility support, a normal multi-page document is often the better design.

Choose the height strategy first

Approach Height behavior Best fit Important limitation
PDFShift 1280xauto calculates height from rendered content Ruby code that should produce a continuous page with minimal browser management Rendering behavior depends on the service and the target page
Pdfcrowd setPageHeight("-1") expands the page vertically Ruby clients that want an explicit unbounded-height setting Pdfcrowd documents 200 inches as a safe maximum for other custom heights because larger pages may fail in some viewers
Browserless Calculate height in the /function API Pages requiring custom browser-side measurement The ordinary /pdf endpoint creates paginated output, not one continuous page
Playwright Ruby Caller measures content and passes a height to Chromium’s page.pdf Teams operating their own browser runtime The API exposes width, height, margins, paper formats, ranges and output paths, but does not promise automatic content-height sizing
PDFKit/wkhtmltopdf Uses wkhtmltopdf page-size options Existing WebKit-based Ruby deployments The cited project does not establish an automatic single-page content-height mode
Prawn You define the document layout in Ruby Programmatic PDFs that do not originate as HTML It is not an HTML browser renderer

Generate a full-height PDF with PDFShift

Prerequisites

  • Ruby with the standard net/http, uri and json libraries.
  • A PDFShift API key stored outside source control.
  • A public URL or HTML input that the service can render.
  • Writable storage for the binary PDF response.

Ruby example for a URL

The following program posts JSON, requests a 1,280-unit page width with automatic height, checks the HTTP status and writes the response in binary mode.

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.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.
require "net/http"
require "uri"
require "json"

endpoint = URI("https://api.pdfshift.io/v3/convert/pdf")
request = Net::HTTP::Post.new(endpoint)
request["Content-Type"] = "application/json"
request.basic_auth("YOUR_PDFSHIFT_API_KEY", "")
request.body = JSON.generate(
  source: "https://example.com/report",
  format: "1280xauto"
)

http = Net::HTTP.new(endpoint.host, endpoint.port)
http.use_ssl = endpoint.scheme == "https"
http.open_timeout = 15
http.read_timeout = 120

response = http.request(request)
unless response.is_a?(Net::HTTPSuccess)
  warn "PDF conversion failed (#{response.code}): #{response.body}"
  exit 1
end

File.binwrite("output.pdf", response.body)
puts "Wrote output.pdf (#{response.body.bytesize} bytes)"

Replace the URL with the page you need to render. Keep the API key in an environment variable in production; the literal placeholder above is only for showing the request shape. The response body is PDF bytes, so File.binwrite (or an equivalent binary write mode) is required.

Rendering HTML instead of a public URL

If your provider account and API version accept HTML input, send the HTML string in the request field documented by that provider rather than a URL. Keep format: "1280xauto" unchanged. Inline or otherwise make available every stylesheet, font and image the renderer needs; a private asset URL that the service cannot reach will produce an incomplete page.

Controlling width

The width in 1280xauto is part of the rendered layout. A wider page can reduce vertical length by allowing more content per line, while a narrower width usually increases height. Pick a width that matches the intended viewport and test responsive breakpoints. Do not assume CSS pixels, PDF points and physical inches are interchangeable without checking the provider’s dimension rules.

Pdfcrowd: explicit unlimited page height

Pdfcrowd’s Ruby API documents setPageHeight("-1") for a single page that expands vertically to fit all content. This is useful when you want the height behavior to be visible in application code instead of inferred from a format string.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
# Illustrative Pdfcrowd Ruby flow
converter = Pdfcrowd::HtmlToPdfClient.new("USERNAME", "API_TOKEN")
converter.setPageHeight("-1")
converter.convertUrlToFile("https://example.com/report", "output.pdf")

Use the exact constructor and conversion method from the version of the Pdfcrowd Ruby client you install. Pdfcrowd also cautions that 200 inches is a safe maximum for other custom heights because some viewers may not handle larger pages reliably. The negative-height mode and a very large explicit height are therefore different choices.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

Browserless and Playwright: measure, then pass the height

Why Browserless /pdf is not enough

Browserless documents that its REST /pdf endpoint produces paginated PDFs. For one continuous page, use its /function API to run browser code that measures the rendered document and then supplies a calculated height. This adds control, but also makes your implementation responsible for waiting until fonts, images and lazy content are ready.

Playwright Ruby measurement pattern

With Playwright Ruby, load the page, wait for the content you depend on, measure the document, and pass the result to page.pdf. The exact launch and page setup depend on the Playwright Ruby release you use; the core operation looks like this:

page.goto("https://example.com/report", wait_until: "networkidle")
page.wait_for_selector("#report-ready")

content_height = page.evaluate(<<~JS)
  () => Math.max(
    document.body.scrollHeight,
    document.documentElement.scrollHeight,
    document.body.offsetHeight,
    document.documentElement.offsetHeight
  )
JS

page.pdf(
  path: "output.pdf",
  width: "1280px",
  height: "#{content_height}px",
  margin: { top: "0", right: "0", bottom: "0", left: "0" },
  print_background: true
)

Measure after lazy images have loaded. If content can expand after the measurement, the bottom of the PDF will be clipped; wait for a stable application marker or explicitly await image completion before measuring.

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

Options that affect the final height

Wait conditions

  • Selector: wait for the report container or a ready marker.
  • Delay: useful for animations or late client-side rendering, but less deterministic than a marker.
  • Network idle: helps pages whose data arrives through requests, though analytics and live connections can prevent an idle state.

Lazy-loaded content

Scroll-triggered images may not exist when the first height is measured. Force the page to reveal lazy sections, wait for image completion, then measure. A service that supports full-page capture with lazy images loaded can simplify this step, but you should still verify the output for pages with custom loaders.

CSS and print behavior

Print styles can change display, colors and dimensions. Enable print backgrounds when the design requires them, remove default margins if the page itself owns spacing, and inspect @media print rules. Fixed-position headers, sticky elements and CSS transforms can overlap or inflate measurements.

Fonts and external assets

Web fonts that have not finished loading can change line wrapping and therefore total height. Wait for document.fonts.ready where your browser stack supports it. Ensure authenticated images, CSS and fonts are reachable with the headers or cookies supplied to the renderer.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

Ruby API reliability and cost considerations

  • Set separate connect and read timeouts. Rendering a large page can legitimately take longer than a normal API call.
  • Check status codes and content type before saving. An HTML error document saved as .pdf is a common debugging trap.
  • Write to a temporary file, validate it, then atomically rename it when generating downloads in a web app.
  • Use idempotency or your provider’s job mechanism when retrying expensive conversions, so a network timeout does not create duplicate work.
  • Record the target URL, rendering options and provider request identifier, but never log API keys or sensitive page contents.
  • For very tall output, test the PDF in the viewers your users actually have. A technically valid file can still be difficult to render or print.

Troubleshooting full-height output

The PDF is still split across pages

You used a paginated endpoint or a normal paper format. Switch to PDFShift’s 1280xauto, Pdfcrowd’s setPageHeight("-1"), or a measured height passed to Playwright/Browserless /function.

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

The bottom of the document is missing

Measurement happened before lazy content, fonts or asynchronous data finished. Wait for a deterministic ready selector, load images, await fonts and measure again.

The output is blank or contains an error page

Check authentication, redirects, TLS access and the response status. Confirm that the renderer can reach private assets and that you are saving the binary response rather than parsing it as text.

Images or backgrounds disappear

Verify absolute asset URLs, enable print backgrounds where supported, and provide the required cookies or authorization headers. Browser-rendered services may also differ in how they apply print CSS.

A huge page will not open in a viewer

Reduce the width or content, use a supported maximum height, or choose a paginated PDF. Pdfcrowd’s documentation identifies 200 inches as a safe maximum for other custom heights; it is not a guarantee that every viewer accepts arbitrary dimensions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

Ruby times out

Increase the read timeout only after checking the page itself. Long-running scripts, never-ending network connections, blocked resources and bot checks can all prevent completion. Add a bounded wait condition and capture provider diagnostics when available.

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 provides a one-call capture API and an MCP server for AI agents. Its cleanup step accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be turned off. It does not bill bot checks/CAPTCHAs, blank pages, timeouts, failed loads or cache hits, and the response identifies the result with X-Page-Verdict and X-Billed headers.

For a direct request, see the ScreenshotNeo documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo also offers PDF capture, HTML/CSS rendering, custom JavaScript, waits, headers, cookies, user agents, geolocation, caching, asynchronous jobs, bulk capture and signed webhooks. Its MCP tools—take_screenshot, get_page_info and capture_pdf—work with Claude, Cursor and other MCP clients. The call above saves an image; choose the PDF capture option documented for your account when your deliverable is a PDF, and verify whether your target requires a continuous page or standard pagination.

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

The Free plan includes 1,000 screenshots per month with no card. Starter is $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000; yearly billing gives two months free, and every feature is on every plan. Create a free ScreenshotNeo account.

Ruby alternatives when HTML is not the source

HTML2PDFAPI

HTML2PDFAPI documents Ruby Net::HTTP and Rails/HTTParty requests, accepts HTML or a URL, and exposes options such as page format, landscape and print backgrounds. Its cited documentation does not state a dedicated automatic-height flag, so confirm the page-size behavior before choosing it for a single continuous page.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

DocRaptor

The Ruby client accepts document content or a URL and returns a generated PDF. The cited client documentation does not specify a full-height setting; treat continuous-page sizing as an implementation detail to verify with the provider.

Prawn

Use Prawn when you are constructing the PDF directly with Ruby objects and coordinates. It avoids browser rendering entirely, but you must implement layout, wrapping, pagination or custom page sizing yourself.

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

Recommended decision

  1. Choose PDFShift when you want the shortest documented Ruby path: post JSON with 1280xauto and save the binary response.
  2. Choose Pdfcrowd when an explicit setPageHeight("-1") control fits your client design.
  3. Choose Browserless /function or Playwright when you need browser-side measurement and can own waits, asset loading and height calculation.
  4. Choose pagination instead when the PDF must print cleanly, remain easy to navigate or work across conservative viewers.

Frequently Asked Questions

Can a full-height PDF have a fixed width?

Yes. Set a fixed width such as PDFShift’s 1,280-unit width and let the height expand from the rendered content.

Does disabling CSS page breaks create one long page?

No. Page-break rules affect pagination; they do not automatically change the PDF’s physical page height.

Should I use an enormous fixed height instead of auto sizing?

Usually no. A measured or provider-supported automatic height avoids excess blank space and reduces viewer-compatibility problems.

Is Prawn suitable for converting an existing webpage?

Not directly. Prawn is for constructing PDFs programmatically; use an HTML-capable renderer when the source is a webpage.

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

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.