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

If images appear in your browser but disappear from a generated PDF, first identify whether each missing item is an <img>, an SVG/image resource, or a CSS background. Then check the renderer’s print-media rules, confirm that its process can access the image URL, and inspect the converter’s load errors. These cases have different fixes: turning on background printing will not repair a failed image request.

Start by identifying the missing image type

“Image” can mean several things in a web page, and a PDF renderer may handle them differently. Inspect the generated HTML and styles to determine how the missing visual is supplied before changing converter options.

Ordinary image elements

An <img src="…"> element depends on the renderer resolving and loading its src. Check the final value of src, the resolved URL, the response status, and the element’s load or error state. A browser and a PDF service may run with different base URLs, credentials, filesystem access, or network permissions.

SVG and other image resources

SVG may be embedded in the document or referenced as a resource. Determine which form your template uses and whether that resource is reachable from the converter. WeasyPrint’s documentation describes support for raster and SVG images and explains that external resources are fetched through a URL fetcher; fetch failures can appear as warnings. See WeasyPrint’s First Steps guide.

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

CSS background images

A background such as background-image: url(...) is not an <img>. Some renderers suppress background graphics when printing unless an option enables them. First verify the relevant renderer setting; do not use it as a blanket fix for missing image elements.

Check the PDF’s CSS media type and layout

PDF conversion often uses a different CSS presentation from the browser screen. Puppeteer’s Page.pdf() uses print media by default, so inspect @media print rules for display: none, visibility changes, replaced content, or layout changes that hide or move the image.

If the intended PDF should use screen styling, Puppeteer documents switching media before PDF generation:

await page.emulateMediaType('screen');
await page.pdf({ path: 'output.pdf' });

Make that choice deliberately: print and screen layouts may serve different purposes. The relevant behavior is documented in Puppeteer’s Page.pdf() method.

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

Turn on background printing only when the missing item is a background

Puppeteer’s printBackground PDF option defaults to false. Set it to true when the missing visual is a CSS background or other background graphic:

await page.pdf({ path: 'output.pdf', printBackground: true });

This controls background printing; it does not make an inaccessible <img src> load. See the Puppeteer PDFOptions interface.

Verify resource URLs from the converter’s environment

A page that loads on a developer’s computer does not prove that the PDF process can load the same resource. Diagnose from the machine, container, or worker that actually renders the document.

  • Resolve relative paths. Confirm the document’s base URL and the absolute URL produced for each relative image path. A path valid in a local browser may resolve differently in a job runner.
  • Check local-file access. Confirm the file exists at the path visible to the rendering process and that the process has permission to read it. Avoid broadly enabling filesystem access: grant access only to the directories the job requires, particularly if it processes untrusted HTML or CSS.
  • Check remote access. Verify outbound network access, DNS, proxy and certificate configuration, authentication, and any required headers or cookies. A converter may not share the browser session that displayed the page.
  • Inspect the renderer’s fetching mechanism. WeasyPrint fetches external images and stylesheets through a URL fetcher. Its documentation describes custom fetchers for integrations such as framework static or media files, and notes that fetch exceptions may be caught and reported as warnings. Read the WeasyPrint resource-loading guidance and check the stable API reference for the version you use.

Check image and local-file settings in wkhtmltopdf

wkhtmltopdf exposes controls for image loading, JavaScript, media-load errors, and local-file access. Its usage documentation lists --images as enabled by default and --no-images as the option that disables image loading. Check the actual command line and wrapper configuration for that setting.

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

For local assets, verify the relevant version’s local-file access controls and the paths it is expected to read. Do not enable unrestricted access as a generic workaround. If the image is generated by JavaScript, also confirm JavaScript is enabled. Consult the wkhtmltopdf usage documentation for the flags and their behavior.

Wait for dynamic images to finish loading

When JavaScript creates an image or assigns its final src after the initial page load, converting too early can capture an incomplete page. Puppeteer’s PDF guide demonstrates navigating with waitUntil: 'networkidle2' before printing, and its PDF options document waiting for fonts by default. Network idleness and font readiness do not guarantee that every lazy-loaded or application-generated image is ready.

For a Puppeteer job, wait for the application’s own completion condition where possible, then verify each image’s state:

await page.goto('https://example.com/report', { waitUntil: 'networkidle2' });
await page.waitForFunction(() => {
  return [...document.images].every(img => img.complete);
});
await page.pdf({ path: 'output.pdf', printBackground: true });

This example checks whether image requests have completed, not whether each image succeeded. Inspect naturalWidth or application-specific readiness as well, and capture failed requests and response statuses. For lazy images, make sure the page has triggered the relevant loading behavior before treating completion as meaningful. Puppeteer’s guide is at PDF generation.

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.

wkhtmltopdf provides JavaScript enablement and a configurable JavaScript delay, along with media-load error handling. A delay can help diagnose timing, but it does not prove the image URL worked. Prefer an application readiness signal and inspect converter output instead of relying on an arbitrary wait.

Use logs and output to narrow down the cause

Collect evidence from the same conversion run that produced the broken PDF. A useful diagnostic record includes the input HTML, resolved image URLs, the applicable print CSS, request failures and status codes, converter warnings, command-line options, and renderer/version information.

  1. Confirm the input. Save or log the exact HTML and CSS passed to the converter, including any base URL.
  2. Inspect the PDF presentation. Check whether print rules hide the image or change the layout; compare screen and print media intentionally.
  3. Trace each resource. Test the fully resolved URL or local path from the converter’s runtime environment, with the same relevant credentials and permissions.
  4. Read converter diagnostics. Check failed requests and warnings. WeasyPrint may report fetch errors as warnings; wkhtmltopdf exposes media-load error behavior.
  5. Validate the output. Regenerate the PDF after one targeted change and check that the expected image appears in the intended location and size.

These checks distinguish a CSS omission from an inaccessible resource or a timing problem. A fixed delay may conceal a race on one run without correcting a failed request.

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

Choose settings based on the renderer, not a generic checklist

Renderer Media and backgrounds Resource access and diagnostics Timing controls
Puppeteer Page.pdf() uses print media by default. printBackground defaults to false; screen media can be selected deliberately. Inspect page requests, responses, and image state in the browser context running the conversion. The PDF guide shows networkidle2; PDF options wait for fonts by default. Neither ensures every app-specific image is ready.
wkhtmltopdf The usage documentation lists --images as enabled by default and --no-images as disabling images. Check local-file access flags, image settings, and media-load error handling in the command or wrapper. JavaScript can be enabled, and a JavaScript delay can be configured; inspect output rather than assuming a delay fixed loading.
WeasyPrint Check the CSS and image form used by the document; it supports raster and SVG images. External resources use a URL fetcher. Custom fetchers can support application integrations; fetch exceptions may produce warnings. Use warnings and the application’s resource readiness to diagnose; no universal delay setting is established here.

These documented behaviors offer useful comparison points, not a universal ranking of renderers. Verify the documentation for the exact version you deploy.

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

Troubleshoot by symptom

The image is visible in the browser, but absent only from the PDF

  • Inspect print CSS and test the resolved print layout.
  • If it is a background, enable the renderer’s background printing option where applicable.
  • If it is an image element, inspect its resolved URL and fetch result rather than changing background settings.

It works locally but fails in production

  • Compare the converter’s base URL and filesystem paths with the local environment.
  • Confirm the production process has network access, file permissions, and required credentials.
  • Inspect converter warnings and verify the URL or file from the production worker itself.

It appears inconsistently or is generated by scripts

  • Wait for the application’s final image source or readiness condition.
  • Check load and error states; do not equate network idleness with successful image decoding.
  • Review JavaScript and delay settings for the renderer, then validate the PDF and logs.

Or skip the browser setup

If you need a screenshot of a web page rather than a PDF generated from your own HTML pipeline, ScreenshotNeo provides a website screenshot API and MCP server. Its API returns an image or PDF from a GET request. A one-call example:

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 parameters. ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses include X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. These are ScreenshotNeo plan allowances and prices as listed for the service. Sign up for the free plan.

What to report when asking for help

For a focused diagnosis, include the converter and version, whether the missing visual is an <img>, SVG, or CSS background, and the resource-load warning or HTTP failure reported by the converter. Also provide the relevant print CSS and a sanitized resolved URL or local path. Remove secrets such as access tokens and cookies before sharing logs.

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

Frequently Asked Questions

Does setting Puppeteer’s printBackground option fix every missing image?

No. It controls printing background graphics; it does not fix a failed <img src> request.

Does a longer JavaScript delay prove that images loaded?

No. A delay may change timing, but verify image completion and success and inspect the renderer’s diagnostics.

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.