To include S3 images in a Puppeteer PDF, make sure the rendered page can fetch each image, then wait for those specific images to load before calling page.pdf(). For private S3 objects, a presigned URL can grant the browser temporary access. A navigation condition such as networkidle2 is useful, but it does not by itself confirm that every required image loaded successfully.
Why S3 images are missing from Puppeteer PDFs
There are two separate requirements: the browser must be able to retrieve the object, and the image must finish loading before PDF generation. A URL that works from your server does not necessarily work in the browser page. For private objects, the page needs an authorized URL, commonly a presigned URL generated for the object.
Navigation completing is not the same as every image being present and decoded. Puppeteer’s PDF guide demonstrates navigating with waitUntil: 'networkidle2', and notes that page.pdf() waits for fonts by default. That font wait is not a guarantee that your particular image requests succeeded. See the Puppeteer PDF generation guide.
Make the S3 object available to the page
Use a presigned URL for a private object
S3 objects are private by default. A presigned URL grants time-limited access without making the bucket public; AWS documents its use in browsers as well as by programs. Generate it on a trusted server using an identity authorized to read the specific object, then pass only the temporary URL needed for the render. Do not put AWS access keys in page HTML or browser-side JavaScript.
#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.
The presigned URL is tied to the credentials of the principal that created it. It cannot remain valid beyond the validity of those underlying credentials. Choose an expiration long enough for the page render and likely request delays, but do not treat the maximum as a recommended lifetime. AWS documents a maximum configured Signature Version 4 expiration of 604800 seconds (seven days). See AWS: Download and upload objects with presigned URLs and AWS: presigned URL expiration.
Use public access only when the object is meant to be public
A public-access arrangement may suit images intended for anyone to retrieve, but it changes the object’s security posture. Whether it is appropriate depends on your application and bucket configuration. Do not make a bucket public merely to make PDF generation work; use a presigned URL when access should remain temporary and controlled.
Check the exact URL in the rendered page
Inspect the final HTML and the browser’s actual request URL, including the presigned query string. The URL must identify the intended object and authorize the request the browser makes. A URL that was valid when generated can expire before the image request if the render is delayed.
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.
Wait for the images that belong in the PDF
Navigate, trigger lazy images, then verify image elements
The following Node.js example uses Puppeteer and waits for all relevant img elements to complete with a nonzero natural width. It also scrolls through the page to trigger common viewport-based lazy loading. Adapt the selector and loading trigger to your page: a site may load images only after another interaction, and CSS background images are not represented by img elements.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
// Use HTML that contains the intended S3 URL, often a server-generated
// presigned URL for a private object.
await page.goto('https://your-app.example/report', {
waitUntil: 'networkidle2',
timeout: 60000,
});
// Trigger common scroll-based lazy loading. Replace or extend this if
// your page uses a different trigger.
await page.evaluate(async () => {
const step = Math.max(1, Math.floor(window.innerHeight / 2));
for (let y = 0; y < document.body.scrollHeight; y += step) {
window.scrollTo(0, y);
await new Promise(resolve => setTimeout(resolve, 100));
}
window.scrollTo(0, 0);
});
// Wait for the images required by the PDF, not just for navigation.
await page.waitForFunction(() => {
const images = Array.from(document.querySelectorAll('img.pdf-image'));
return images.length > 0 && images.every(img =>
img.complete && img.naturalWidth > 0
);
}, { timeout: 30000 });
await page.pdf({ path: 'report.pdf', format: 'A4', printBackground: true });
} finally {
await browser.close();
}
})();
Give each required image a selector such as pdf-image, or replace that selector with one that precisely matches the images for the output. If zero matching images is a valid page state, change the check accordingly; the example intentionally treats an empty match as a condition to investigate rather than silently printing without images. For pages that may legitimately omit some images, define which ones are essential and validate those separately.
Interpret the readiness check correctly
img.complete indicates the element’s loading process has completed, while naturalWidth > 0 helps distinguish a loaded image from a failed or empty one. A timeout means the condition was not met; it does not tell you whether the cause was an expired URL, a blocked request, a lazy-loading trigger that never ran, or a page-specific issue. Inspect request outcomes to identify the cause before deciding whether to retry or produce a partial PDF.
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.
For images loaded as CSS backgrounds, use a page-specific check—for example, inspect the relevant element’s computed background URL and monitor the corresponding request—or change the page to expose the needed asset as an image element. There is no universal image-wait snippet that can infer every application’s rendering requirements.
Navigation and request handling choices
Choose a navigation condition that fits the page
networkidle2 is a useful starting point and appears in Puppeteer’s PDF guidance. It means the navigation has reached a network-idle condition under Puppeteer’s definition; it is not proof that all images rendered correctly. Pages with ongoing connections, analytics, or delayed content may not settle as expected. AWS’s Puppeteer sample uses load and networkidle0 as options, but these are starting points rather than universal choices. See AWS SDK for JavaScript: presigned URL example.
Recommended Free Tools
Use the navigation condition to get the page to a useful stage, trigger any deferred loading, and then wait explicitly for the images needed by the PDF. If a page has a known application-ready selector, waiting for it can be more meaningful than waiting indefinitely for global network idleness.
Rank #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
Do not leave intercepted requests unresolved
If Puppeteer request interception is enabled, each intercepted request must be continued, answered, or aborted, unless it is completed from the browser cache. A handler that forgets an image request can leave the image stalled and prevent your readiness check from completing. Review Puppeteer’s request interception documentation when using interception.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Print the PDF once the page is ready
After verifying the required images, call page.pdf(). Puppeteer’s PDF output uses print CSS media by default, so a page may display differently than it does on screen. Add printBackground: true if the document needs background graphics. Puppeteer waits for fonts by default during PDF generation, but keep the image check separate; the PDF operation’s font behavior does not replace it.
For long-running jobs, set a practical timeout for navigation and image readiness, and decide what the application should do if a required image fails: fail the PDF job with a useful error, retry after refreshing a presigned URL, or deliberately omit an optional asset. Do not silently generate a document that appears complete when critical images are missing.
Free tools Windows power users keep installed
One-click scans. No signup required.
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.
Diagnose missing or broken images
- Inspect the generated HTML. Confirm the
srcis the intended object URL and that any lazy-loading trigger has run. - Inspect browser requests and responses. Check the failed image’s request URL, status, console messages, and timing before printing. A completed navigation does not establish that the request succeeded.
- Validate the presigned URL. Confirm it targets the correct object, authorizes the browser’s GET request, and has not expired. Confirm the signing credentials were still valid when the request occurred.
- Check authorization and request integrity. AWS identifies expired credentials, signature mismatches, proxies that modify signed requests, and explicit bucket-policy denies as possible causes. Preserve the signed query string and relevant request details through any proxy.
- Review interception logic. If request interception is enabled, make sure the image request is continued or otherwise handled rather than left pending.
- Wait on the specific required images. Check completion and a nonzero natural width before
page.pdf(); do not rely only on navigation idleness or Puppeteer’s font wait.
Or skip the browser setup
If your goal is a clean capture of a web page rather than a custom Puppeteer PDF pipeline, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. It can remove cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. AI agents can take screenshots through its MCP server, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
For API setup and options, see the ScreenshotNeo documentation. Example cURL request:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
This returns a screenshot image, not a PDF generated from your own Puppeteer page. For the browser-controlled S3-to-PDF workflow above, retain the page-specific access and readiness checks. To try ScreenshotNeo, sign up for 1,000 free screenshots a month with no card.
Frequently Asked Questions
Does networkidle2 guarantee that every S3 image is in the PDF?
No. It is a navigation condition; check the specific required image elements and request outcomes before printing.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCan I use a presigned URL for a private S3 image in a browser?
Yes. AWS documents presigned URLs for browser access; keep the URL temporary and ensure it remains valid through the image request.
Will a public S3 bucket fix missing images?
It may make objects retrievable publicly, but that is an access-control choice, not a general PDF fix. Use public access only for content meant to be public.
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.

