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

If Html2Pdf.app returns an empty-looking PDF, first confirm the HTTP status and whether the response is actually the finished PDF. Then check that the renderer can reach the page and its assets, test the relevant render timing and CSS media settings, and make sure your code writes the response as bytes. In callback mode, a 202 Accepted response means the job was queued—not that the PDF is already in the response body.

How Html2Pdf.app generates a PDF—and what a blank file may mean

Html2Pdf.app accepts raw HTML or a publicly reachable page URL in the required html field. Its documentation says, “Conversions run in headless Chromium, providing support for modern HTML, CSS, and JavaScript.” A successful synchronous request returns PDF binary data, so an empty-looking result can stem from an input or rendering issue, an error response saved as though it were a PDF, or code that mishandles the binary response. Html2Pdf.app’s documentation describes the endpoint and request behavior.

1. Check the status code and whether the request is synchronous

Inspect the HTTP status before saving or parsing the response. The API documents these errors:

Status Documented meaning What to check
400 Inaccessible source URL or invalid parameter Verify the input URL or HTML and review parameter names and values.
401 Missing or invalid API key Check that the X-API-Key header is present and valid.
403 Account plan limit Check the account’s plan limit before retrying.
500 Unhandled server error Record the status and response details; the documentation does not identify a specific client-side fix.

The documentation recommends correcting the causes of 400, 401, and 403 responses before retrying. Do not assume a response is a PDF just because the request completed at the HTTP level.

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.

Callback mode returns a queued response first

If your request includes callBackUrl, the initial successful response is 202 Accepted. That confirms the job was queued; it is not the generated PDF. Wait for the callback payload, then base64-decode its document value into a binary file. Treating the initial 202 response body as PDF data will not produce the finished document.

2. Verify the renderer can reach the input and its assets

For URL input, check that the page is public and that the final destination loads without relying on a logged-in browser session. Redirects, access controls, and login requirements are useful diagnostic checks because the renderer needs public access to the source. For raw HTML, inspect external stylesheet, font, and image URLs. Html2Pdf.app’s troubleshooting guidance specifically recommends checking that the source URL and required CSS, fonts, and images are reachable by the renderer. See its Node.js integration guide and cURL integration guide.

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.
  • Open the URL without your usual authenticated browser session and confirm it reaches the intended page.
  • Check whether CSS, font, and image assets use URLs the rendering service can access.
  • For raw HTML, make sure linked assets are not local filesystem paths or otherwise unavailable to the remote renderer.
  • Compare URL input with raw HTML when practical; this can help separate page-access problems from markup or asset problems.

3. Test render timing for late content

If JavaScript or asynchronous resources add content after the initial page load, try the waitFor option. It sets a delay in seconds before PDF generation; the documented range is 0–10 seconds, and the default is 0. Start with a small delay and compare the output. This is a diagnostic for late-arriving content, not a universal fix for blank PDFs.

If the content still does not appear, check whether the page actually inserts it in the renderer-accessible page and whether the required assets load. Increasing the delay cannot repair inaccessible resources or invalid input.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

4. Compare screen and print CSS

The media option selects screen or print; its default is screen. A site may define different visibility, layout, or colors for each media mode. If the PDF is blank or missing expected content, compare the output using the mode that matches the intended document, especially when the site has print-specific CSS. The option changes which media styling applies; it does not make an unreachable asset available.

5. Preserve the PDF response as bytes

For synchronous requests, the successful response is PDF binary data. Check the status first, then save or stream the response bytes without converting them to text or JSON. The endpoint is POST https://api.html2pdf.app/v1/generate and authentication uses the X-API-Key header.

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

Runnable Node.js example

This example sends raw HTML, checks the response, and writes the PDF bytes. Replace the API key with your own; adjust the HTML and options for your case.

const fs = require('node:fs/promises');

async function main() {
  const response = await fetch('https://api.html2pdf.app/v1/generate', {
    method: 'POST',
    headers: {
      'X-API-Key': process.env.HTML2PDF_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      html: '<!doctype html><html><body><h1>PDF test</h1></body></html>',
      media: 'screen',
      waitFor: 0
    })
  });

  if (!response.ok) {
    const details = await response.text();
    throw new Error(`Html2Pdf.app returned ${response.status}: ${details}`);
  }

  const pdfBytes = Buffer.from(await response.arrayBuffer());
  await fs.writeFile('output.pdf', pdfBytes);
}

main().catch(error => {
  console.error(error);
  process.exitCode = 1;
});

Set HTML2PDF_API_KEY in the environment before running the script. For example, on macOS or Linux: export HTML2PDF_API_KEY='your-api-key', then run the file with Node.js. If you use callback mode instead, handle the callback and base64-decode its document field rather than writing the initial 202 response as a PDF.

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.
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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Compare the likely causes systematically

Comparison When it helps What to inspect
Raw HTML vs. public URL When it is unclear whether the page itself or the HTML/assets are causing the output. Whether the renderer can reach the URL and all referenced resources.
screen vs. print When the site applies media-specific styles. Whether the intended content is hidden or changed under one media mode.
No delay vs. a small waitFor When JavaScript or asynchronous loading may add content after initial load. Whether late-arriving content appears within the configured delay.
Synchronous response vs. callback completion When using asynchronous jobs. Whether you wait for the callback and decode its base64 document value.

Troubleshooting by symptom

  • The saved file is not a valid PDF: Check the HTTP status before writing. An error response or a callback-mode 202 response is not the synchronous PDF result.
  • The PDF opens but the page is empty: Confirm public access to the page and reachability of its CSS, fonts, and images; then compare media mode and test a short delay if content loads asynchronously.
  • The page works in your browser but not in the PDF: Check for login requirements, redirects, and assets that are reachable only from your browser or network.
  • The PDF omits content added by JavaScript: Test waitFor within its documented 0–10 second range and verify that the page’s asynchronous resources can load.
  • Your code reports a 400, 401, or 403: Correct the invalid or inaccessible input, API key, or plan-limit issue indicated by the status before retrying.
  • You receive a 500: The documentation identifies this as an unhandled server error but does not establish a specific fix. Preserve the response details when investigating.

Or skip the browser setup

If your goal is a screenshot rather than a PDF, ScreenshotNeo returns a website capture through one GET request. For example, save a WebP screenshot of a URL with cURL:

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

See the ScreenshotNeo API documentation for request details. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000. Sign up for free.

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.