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.

When images disappear from an HTML-generated PDF, first check the exact URL or file path the renderer is trying to load. The usual causes are a wrong base URL, inaccessible or protected assets, JavaScript or lazy loading that has not finished, and unsupported image or CSS features. Fix access and timing before changing the HTML; the browser on your laptop may be able to load an image that the PDF process cannot.

Start by finding the image URL the renderer actually uses

A successful PDF export does not prove that every image loaded. Many renderers keep producing the document after a resource request fails, so the result can have empty spaces while the rest of the page looks correct. Diagnose one missing image at a time, starting with the final resolved URL—not just the value written in the src attribute.

  1. Open the same HTML and image from the machine or container running PDF generation. A URL that works in your own browser may be inaccessible to a server, CI worker, or container.
  2. Log or inspect the resolved image URL and its response. Check the HTTP status, redirects, authentication, MIME type, and capitalization of every path segment; paths can be case-sensitive on the server even if development was not.
  3. Compare the renderer’s warnings with the PDF. If the log names a missing or denied resource, fix that request before investigating layout or PDF settings.
  4. Temporarily replace the failing asset with a small PNG at a known reachable location. If that appears, the issue is probably the original asset’s path, access requirements, format, or CSS treatment rather than PDF generation as a whole.

Keep a record of the final URL and response for each image while debugging. This separates a failed request from an image that loaded successfully but was hidden, clipped, or placed off the printable 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.

Fix relative paths and base URLs

Relative image paths are interpreted against a base URL. If the renderer receives an HTML string rather than opening the original HTML file, it may have no useful base at all. A browser preview can still work because the browser opened the page from a particular directory or domain; the PDF renderer may be resolving the same images/logo.png against a different location.

#1 Best Overall
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
  • Convert your PDF files into Word, Excel & Co. the easy way
  • Convert scanned documents thanks to our new 2022 OCR technology
  • Adjustable conversion settings
  • No subscription! Lifetime license!
  • Compatible with Windows 11, 10, 8.1, 7 - Internet connection required

WeasyPrint: set base_url for HTML strings

WeasyPrint’s API defines base_url as the base used to resolve relative URLs, including paths such as <img src="../foo.png">. When supplying HTML as a string, pass an absolute site URL or a file URL rooted at the directory containing the HTML and its assets.

from pathlib import Path
from weasyprint import HTML

html_path = Path("/srv/app/reports/invoice.html")
html_text = html_path.read_text(encoding="utf-8")

HTML(
    string=html_text,
    base_url=html_path.parent.as_uri(),
).write_pdf("invoice.pdf")

For an HTML document whose images are hosted on a public site, use that site’s page URL as the base instead. Do not assume that the process’s current working directory is the HTML file’s directory. If the image is not beside the page, verify that the relative path is correct from the chosen base.

Other renderers: inspect the effective location

If your renderer opens an HTML file directly, test whether its file location gives the relative paths you expect. For remote HTML, check whether relative image paths resolve against the intended page URL. If you construct or rewrite HTML before rendering, keep the base document location consistent with where its relative assets live.

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

Allow access to local files and protected images

PDF generation often runs with stricter access than an interactive browser. A local image may be outside the renderer’s allowed directories, while a remote image may need a login cookie, authorization header, or signed URL. Making the file readable to your own account does not necessarily give a renderer process access to it.

Rank #2
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
  • Transform audio playing via your speakers and headphones
  • Improve sound quality by adjusting it with effects
  • Take control over the sound playing through audio hardware

wkhtmltopdf: grant the narrowest local-file access needed

wkhtmltopdf loads images by default, but local-file access is disabled by default. For a trusted document that needs local assets, enable access or allow only the relevant directory. Prefer the narrower directory allow-list when practical rather than granting broad filesystem access.

wkhtmltopdf --enable-local-file-access 
  /srv/app/reports/invoice.html invoice.pdf

Or restrict access to the directory holding the assets:

wkhtmltopdf --allow /srv/app/reports/assets 
  /srv/app/reports/invoice.html invoice.pdf

Use the option appropriate to the installed wkhtmltopdf build and review its output for resource-loading errors. If enabling access does not help, verify that the renderer’s operating-system user can read the file and that the HTML points to the actual file location.

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

WeasyPrint: provide a fetcher for credentials or custom mappings

WeasyPrint can load ordinary files, HTTP, FTP, and data URLs. Its default fetching does not automatically handle HTTP authentication or cookies. If an image is protected, supply a custom URL fetcher that can attach the required credentials or map application-specific paths to accessible files. Keep secrets out of generated HTML and logs.

Rank #3
Sale
Data Recovery Stick for Windows Data Recovery Software – Photos, Files
  • The Data Recovery Stick requires no technical skills — simply plug it into your Windows computer, click Start, and the software automatically begins scanning and recovering lost files within minutes. Compatible with Windows Vista, 7, 8, 10, & 11, it's designed to be a reliable first step when accidental deletion occurs.
  • Recover photos (JPG, BMP, PNG, TIFF), Microsoft Office documents (Word, Excel, PowerPoint, Publisher, Access), Open Office files, MP3 music files, PDFs, RTF documents, AutoCAD files, and HTML web pages. Whether it's personal memories or critical business files, the Data Recovery Stick covers the file types that matter most.
  • Works with hard drives, USB drives, SD cards, memory sticks, and other common storage formats that use FAT or NTFS file systems — making it a single solution for hard drive recovery, USB drive recovery, SD card recovery, and more. Note: a media reader is required for micro SD cards and some mass storage devices.
  • No Installation Required - The Data Recovery Stick runs entirely from the USB drive with no software installation on your computer — helping prevent new data from overwriting the files you're trying to recover. This also makes it ideal for use across multiple computers or in emergency situations where installation isn't practical.
  • Use the Data Recovery Stick on as many computers as often as needed — simply clear the recovered data between uses to free up storage space. Software updates keep the tool compatible with newer systems and devices, backed by 25+ years of data software expertise from Paraben Consumer Software.

For remote assets, confirm that the renderer can reach the host and follow any required redirects. If an asset URL expires, generate a URL that remains valid for the full rendering job or fetch the image through an authenticated mechanism your renderer supports.

Wait for JavaScript, lazy loading, and image decoding

HTML-to-PDF output can capture the page before a script inserts an image or before a lazy-loaded image is requested. A page’s initial load event is not always a reliable signal that charts, client-side templates, or images are ready to print.

wkhtmltopdf: enable scripts and set a deliberate delay

wkhtmltopdf provides --enable-javascript and --javascript-delay <msec>. Enable JavaScript when the page depends on scripts, then choose a delay long enough for the relevant image requests and rendering to complete. A delay is a blunt fallback: a fixed wait can be wasteful on fast pages and insufficient when a dependency is slow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf --enable-javascript --javascript-delay 1500 
  https://example.com/report report.pdf

Replace the example delay with one appropriate to the page, and inspect the output on the slowest realistic environment. If the page has an application-specific ready signal, use that instead of guessing a delay when your renderer supports it.

Rank #4
Convert to PDF
  • Export or Convert Text, HTML, PNG, JPG, or Camera Pictures to PDFs
  • Unlimited use
  • No ads
  • No personal data taken
  • GDPR compliant

Chromium and Puppeteer: wait for the page’s own ready condition

For Puppeteer, wait for an application-specific readiness flag or for the page’s image-loading work to finish before calling PDF generation. A small page-side helper can wait for images already present in the DOM to complete and decode:

await page.goto(url, { waitUntil: "networkidle0" });

await page.evaluate(async () => {
  const images = Array.from(document.images);
  await Promise.all(images.map(async (img) => {
    if (!img.complete) {
      await new Promise((resolve) => {
        img.addEventListener("load", resolve, { once: true });
        img.addEventListener("error", resolve, { once: true });
      });
    }
    if (img.complete && img.naturalWidth > 0 && img.decode) {
      try { await img.decode(); } catch (_) {}
    }
  }));
});

await page.pdf({ path: "report.pdf", printBackground: true });

This example waits for images in the current DOM; it cannot force a page to create images it has not yet inserted. For a single-page application, wait first for the application’s own content-ready condition. If the page uses lazy loading, scroll the relevant content into view or otherwise trigger its loading before waiting for image completion.

Chromium-based rendering also depends on a working browser runtime. If Puppeteer fails before reaching the PDF step, check that required system libraries are installed, container or sandbox permissions allow Chromium to launch, and the installed Chromium and Puppeteer versions are compatible.

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.

Check image formats and print CSS

A blank image region can indicate unsupported content rather than a path problem. WeasyPrint supports raster formats available through Pillow and SVG used in an <img>, <embed>, or <object> element. Convert a troublesome image to PNG or JPEG, or test a supported SVG, to isolate format support. If the rest of the document renders but a particular image format does not, conversion is a useful diagnostic and may be the practical fix.

Best Value
MixPad Multitrack Recording Software for Sound Mixing and Music Production Free [Mac Download]
  • Mix an audio, music and voice tracks
  • Record single or multiple tracks simultaneously
  • Intuitive tools to split, trim, join, and many other editing features
  • Loaded with audio effects including EQ, compression, reverb, and more.
  • Load an audio file and export to all popular audio formats from studio quality wav to high compression formats

CSS can also make an otherwise loaded image disappear. Check print-specific styles for display, visibility, opacity, zero dimensions, clipping, overflow, and page-break behavior. Render a simplified version of the page with the image in ordinary document flow. If that works, reintroduce the styling gradually to find the unsupported or conflicting rule.

WeasyPrint may omit unsupported CSS features while continuing to render the rest of the document. Therefore, a valid PDF does not guarantee that every visual feature was applied. Keep the print stylesheet simpler than a highly interactive screen layout when possible.

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

Make missing resources visible in logs and CI

WeasyPrint commonly reports missing images and other resource-fetching problems as warnings while still producing a PDF. During diagnosis, treat those warnings as a failed document build instead of accepting a visually incomplete file. For mandatory assets, its URL-fetching hooks can raise FatalURLFetchingError so a failed fetch stops the job.

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

In a CI pipeline, capture renderer output and scan for resource warnings. Set an acceptance check that verifies expected images are present in a representative PDF, not merely that a PDF file exists. This catches regressions caused by a changed asset path, a deployment permission change, or an expired remote URL.

Renderer-specific quick reference

Renderer or case First fix to try Next diagnostic
WeasyPrint with an HTML string Set base_url to the site or asset directory. Check fetch errors; add a custom URL fetcher for authenticated or application-mapped assets.
wkhtmltopdf with local images Use --enable-local-file-access or a narrow --allow path. Inspect load-media errors and verify the renderer user can read the files.
JavaScript-generated or lazy image Wait for the page-specific readiness condition; use a delay only where appropriate. Confirm the image exists in the DOM, then wait for its request and decode.
One format or visual feature fails Test a PNG or JPEG and simplify the image’s CSS. Separate fetch failure from format or CSS support by testing the asset in a plain layout.
Chromium/Puppeteer cannot render reliably Check runtime libraries and launch permissions. Verify Puppeteer and Chromium version compatibility, then inspect browser logs.

Common symptoms and fixes

  • The image works in a browser but not from an HTML string: The renderer may lack the page’s original base location. Set base_url or use an absolute resource URL.
  • Only local images are missing under wkhtmltopdf: Local-file access is disabled by default. Allow the specific assets directory or enable local access for a trusted input.
  • Only images behind login fail: The renderer does not share your browser’s session automatically. Supply the needed credentials through a supported fetcher or make the resource available to the render job securely.
  • Charts or images appear intermittently: Rendering may start before JavaScript inserts the image or before lazy loading finishes. Wait on a page-ready condition, then verify image completion.
  • The PDF exists but logs mention failed resources: The renderer may continue after warnings. Treat mandatory-resource warnings as errors and fail the generation job.
  • One image remains blank after its URL is reachable: Test a common raster format and remove complex print CSS to distinguish format support from styling problems.
  • Puppeteer fails before producing any page output: Investigate Chromium’s runtime libraries, container permissions, and version compatibility rather than the image markup alone.

Or skip the browser setup

If the page you need is reachable by URL and you want a rendered PDF without installing or operating a browser renderer, ScreenshotNeo offers a website screenshot API and MCP server. It can return a screenshot or PDF; its consent-banner, popup, and chat-widget removal steps can be turned off. For a local HTML file or an asset that only exists inside your application environment, use the renderer fixes above unless you first make the page reachable to the service.

The request below shows the documented one-call screenshot form for a URL; it saves the default WebP response. See the ScreenshotNeo documentation for PDF capture options and other parameters.

curl -G "https://api.screenshotneo.com/v1/shot" 
  -d access_key=YOUR_API_KEY 
  --data-urlencode url=https://stripe.com 
  -o shot.webp
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)
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie banners, newsletter popups, and chat widgets are removed before the shot; each removal step can be disabled.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; responses identify the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
  • The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

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

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

Quick Recap

Bestseller No. 1
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
PDF Converter Ultimate - Convert PDF files into Word, Excel, PowerPoint and others - PDF converter software with OCR recognition compatible with Windows 11 / 10 / 8.1 / 8 / 7
Convert your PDF files into Word, Excel & Co. the easy way; Convert scanned documents thanks to our new 2022 OCR technology
$29.99
Bestseller No. 2
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
DeskFX Free Audio Effects & Audio Enhancer Software [PC Download]
Transform audio playing via your speakers and headphones; Improve sound quality by adjusting it with effects
Bestseller No. 4
Convert to PDF
Convert to PDF
Export or Convert Text, HTML, PNG, JPG, or Camera Pictures to PDFs; Unlimited use; No ads; No personal data taken
$4.99
Bestseller No. 5
MixPad Multitrack Recording Software for Sound Mixing and Music Production Free [Mac Download]
MixPad Multitrack Recording Software for Sound Mixing and Music Production Free [Mac Download]
Mix an audio, music and voice tracks; Record single or multiple tracks simultaneously; Intuitive tools to split, trim, join, and many other editing features

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.