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

For a Puppeteer PDF on AWS Lambda, load Google Fonts for the page and style header and footer templates separately. Page.pdf() waits for the page’s font loading to settle by default, but that does not prove Google’s stylesheet or font file loaded—or that a font used by the page will be available in a header or footer template. Use explicit template styles and fallbacks, inspect failed requests in the deployed function, and test the exact Lambda, Chromium and Puppeteer combination you plan to ship.

Why page text and PDF headers or footers can use different fonts

Puppeteer’s Page.pdf() prints using the CSS print media type. The page body is rendered from the document and its stylesheets; headerTemplate and footerTemplate are separate HTML strings supplied as PDF options. Puppeteer documents the template constraints and special classes, but its API does not promise that a page’s stylesheet or font declarations will automatically apply inside those strings.

That distinction matters with Google Fonts. The browser normally requests a stylesheet from Google Fonts and then requests the font file described by that stylesheet. A page font can therefore fail because either request fails. Even if the page’s text looks right, do not assume the template text has inherited the page’s font or can reach the same remote font assets.

The reliable starting point is to define the family and a generic fallback for print page content, set a font family and fallback inline in each template, and verify the result in the deployed browser. If repeatable typography matters more than avoiding packaging work, use a suitably licensed local font and test its character coverage.

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
VEVOR 12U Open Frame Server Rack, 23-40 in Adjustable Depth, Free Standing or Wall Mount Network Server Rack, 4 Post AV Rack with Casters, Holds All Your Networking IT Equipment AV Gear Router Modem
  • Adjustable Depth: 23-40'' adjustable depth is used for servers and network equipment, ensuring enough space for AV equipment, components, and cabling, while allowing you to access ports and equipment from multiple sides.
  • Strong Load Capacity: Ground-Mounted Load Capacity: 500 lbs, Wall-Mounted Load Capacity: 150 lbs. The av rack is made of carbon steel for better weldability performance and can help save space while meeting your need to place multiple devices.
  • User-friendly Design: Ergonomic design makes the open frame av rack easier to use. The additional top panel is able to place other items with more available space. Roller design moves anywhere and anytime, is convenient, and is more energy-saving.
  • Complete Accessories: We provide the accessories you need, including 2 x Pallets, 145 x M5*10 Cross Head Screws, 4 x Casters, 4 x M10*50 Expansion Screws,10 x M6*12 Cage Nuts, 1 x Grounding Wire, 1 x User Manual.
  • Wide Application: The server rack wall mount maximizes the use of available space, suitable for retail venues, classrooms, offices, and other places where space is limited.

Load a Google Font for the page content

Google’s documented web-font setup uses a stylesheet link and a CSS font-family declaration. Add the stylesheet to the page you are printing, then make sure the family is applied to the content under print styles too. For example, a page can include this in its <head>:

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap">
<style>
  body {
    font-family: Roboto, Arial, sans-serif;
  }
  @media print {
    body {
      font-family: Roboto, Arial, sans-serif;
    }
  }
</style>

This example requests Roboto weights 400 and 700. Match the weights used by the page to the weights requested; requesting one weight does not establish that another is available. A generic fallback such as Arial, sans-serif gives the browser a defined alternative if Roboto cannot be used. If you control the HTML, add the link before PDF generation. If you do not, inject or otherwise arrange the stylesheet before printing, and verify that the target page’s content and policies allow it.

Set typography directly in header and footer templates

Pass each template through displayHeaderFooter: true. Put its font declaration directly on an element in the template rather than relying on a selector in the page document. Puppeteer recognizes special classes including date, title, url, pageNumber and totalPages; use them where the corresponding generated value belongs.

Rank #2
Sale
StarTech 25U 4-Post Open Frame Server Rack, 19in, 1200lb/544kg, Mobile
  • ADJUSTABLE DEPTH: 4-Post 25U open frame server rack with 4 vertical rails and adjustable mounting depth 22" to 40" (56,0cm to 101,7cm); Compatible with various servers / switches / data / AV and other IT equipment; EIA/ECA-310-E Compliant
  • EASY ASSEMBLY: Mobile network rack with easy-to-follow assembly instructions and online video; Compact flat-pack shipping to avoid damage and facilitate installation; Total product height of 50.8in (129cm) with casters, 48in (122cm) without casters
  • COLD ROLLED STEEL: Durable 4 Post 19in open frame rack designed for ventilation with 25U mounting height and 1200lb (544kg) weight capacity (stationary); 3 install options included: casters, levelling feet, or base-plate to secure rack to the floor
  • HARDWARE INCLUDED: Rolling computer/data rack includes cage nuts and screws to mount equipment, easy to read Units (U) and depth adjustment markings, cable management hooks for organization, and required assembly tools
  • THE IT PRO'S CHOICE: Designed and built for IT Professionals, this 25U rack is backed for 2-years, including free lifetime 24/5 multi-lingual technical assistance
const headerTemplate = `
  <div style="width:100%;font-family:Roboto,Arial,sans-serif;font-size:9px">
    Monthly report
  </div>`;

const footerTemplate = `
  <div style="width:100%;font-family:Roboto,Arial,sans-serif;font-size:9px;text-align:right">
    <span class="pageNumber"></span> / <span class="totalPages"></span>
  </div>`;

Inline styling makes the intended family and fallback explicit, but it does not guarantee that a remote Google font will load in a template. Test that specific behavior with the Chromium build you deploy. For more predictable output, make a local font available to the rendering environment and test a template using it; retain a fallback for cases where the intended face or particular glyph is unavailable.

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

Generate a PDF and record font-related failures

The following Node.js example shows the PDF-generation flow, including the Google Fonts stylesheet, request-failure logging, explicit font waiting, and header and footer templates. It uses the regular Puppeteer launch call to make the rendering logic clear. On Lambda, the launch configuration and browser executable must match the Chromium package, runtime, architecture and deployment method you actually use; there is no universal launch recipe established for every such combination.

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

async function makePdf(url) {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();

    page.on('requestfailed', request => {
      console.error('Request failed:', request.url(), request.failure()?.errorText);
    });
    page.on('console', message => {
      if (message.type() === 'error') console.error('Browser console:', message.text());
    });

    await page.goto(url, { waitUntil: 'networkidle2' });
    await page.bringToFront();

    const pdf = await page.pdf({
      path: '/tmp/report.pdf',
      format: 'A4',
      printBackground: true,
      displayHeaderFooter: true,
      waitForFonts: true,
      headerTemplate:
        '<div style="width:100%;font-family:Roboto,Arial,sans-serif;font-size:9px">Report</div>',
      footerTemplate:
        '<div style="width:100%;font-family:Roboto,Arial,sans-serif;font-size:9px;text-align:right"><span class="pageNumber"></span> / <span class="totalPages"></span></div>',
      margin: { top: '36px', right: '36px', bottom: '36px', left: '36px' }
    });

    return pdf;
  } finally {
    await browser.close();
  }
}

makePdf('https://example.com')
  .then(pdf => console.log('Created PDF bytes:', pdf.length))
  .catch(error => {
    console.error('PDF generation failed:', error);
    process.exitCode = 1;
  });

Replace the example URL with the page you need to render. In a Lambda handler, return or store the resulting PDF bytes according to your application’s response path; the example writes a local copy at /tmp/report.pdf and also returns the bytes. The path output is useful for inspection in a compatible local run, but it is not a substitute for wiring the result into your Lambda’s response or storage workflow.

Rank #3
VEVOR 9U Open Frame Server Rack, 23''-40'' Adjustable Depth, Free Standing or Wall Mount Network Server Rack, 4 Post AV Rack with Casters, Holds All Your Networking IT Equipment AV Gear Router Modem
  • Adjustable Depth: Depth adjustable from 23" to 40", this open frame server rack accommodates servers and network equipment while providing ample space for A/V gears and cable management. Enjoy easy access to ports and devices from multiple angles.
  • High Weight Capacity: Supports up to 300 lbs on the floor (200 lbs when adjusted to maximum depth) and 200 lbs when wall-mounted (depth cannot be adjusted in wall-mounted mode). Made from carbon steel for superior welding performance and durability, this open frame rack is designed to save space while accommodating multiple devices.
  • User-Friendly Design: Designed with your convenience in mind, this open frame server rack features an top shelf for extra storage and improved space utilization. The rolling casters let you move it effortlessly wherever you need it, making setup and movement a breeze.
  • Widely Applicable: Maximize your space with this adaptable open frame server rack, designed to make the most of every inch. Ideal for retail spots, classrooms, offices, and any area where space is at a premium, it delivers practical solutions for your storage needs.
  • Everything You Need: Our open-frame rack comes with fully equipped accessory kit for easy setup and secure installation: 2 x Trays, 4 x Casters, 1 x set of Screws, 16 x M6*12 Cage Nuts, 1 x Grounding Wire, 1 x Internal & External Hex Wrenches, and 1 x User Manual.

Puppeteer’s PDF guide uses networkidle2 in an example, and this code uses it as a convenient navigation wait. It is not proof that a particular stylesheet or font file loaded: an idle network can also mean that a request failed or the page never requested the expected face. The waitForFonts option is explicit here; the Puppeteer API reference documents it as true by default and describes it as waiting for document.fonts.ready to resolve. If the page is backgrounded and that wait does not resolve, Puppeteer notes that bringing it to the front may be required. Neither behavior proves that the requested Google font successfully downloaded.

Choose remote Google Fonts or a bundled font

Approach Useful when Trade-off to check
Google Fonts at render time You want to use the Google Fonts stylesheet and browser-delivered font files without bundling the font yourself. The deployed browser must reach both the stylesheet and the font file. Inspect failures for each request; availability cannot be assumed for every Lambda network configuration.
Bundle or self-host a font You need fewer dependencies on live font-service requests and want a controlled asset. Include the asset in the deployment, check its license and required glyph coverage, and verify that the deployed browser can load it.
Page CSS plus explicit template styling You need page typography and want header and footer text to name their intended family too. Page CSS does not establish template inheritance. Test the template font source separately in the deployed browser.

Google states that its fonts use open-source licenses and can be used in commercial and non-commercial projects. Check the individual font’s license and packaging requirements before bundling it. For either approach, test the scripts and special characters your documents need; a family name alone does not establish that every required glyph will render.

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

Deploying the renderer on AWS Lambda

Headless Chromium is a substantial deployment dependency, and Puppeteer’s Lambda troubleshooting guidance discusses package-size challenges and points to the community sparticuz/chromium project. That reference is not certification of every version, runtime or architecture pairing. Select compatible versions of Puppeteer and Chromium, along with a supported Lambda Node.js runtime, architecture and packaging method. The appropriate launch settings depend on those choices.

Rank #4
AxcessAbles 22U 19-Inch Rolling IT Server Rack 550LB Heavy Duty Open Frame with Removable Side Panels Large 3-Inch Locking Casters for Servers Networking and Rackmount Gear Includes 5mm and 6mm Screws
  • 22U Universal 19 inch equipment Rack Cabinet with Locking Wheels for AV, Networking, Computer Server, Home Theater Rack-mountable Gear.
  • Compatible with American 5mm and European 6mm rack mount standards. Screws packs for both are included.
  • Open Front and Back, 22U Rack Spacing Design with Protective-Vented Side Panels. Front and Real Rail Rack. No Door. Textured-Matte Black Finish. Holds AV/Networking Equipment up to 18-inches Deep.
  • Front locking 3" Caster Wheels move easily on carpet. 1U Blank Panel is included. Dimensions Assembled: 18” x 20” x43” with wheels. Weight Capacity is 440lbs with wheels and 550lbs without wheels.
  • This Standard 19" 22U Rack is Ideal for businesses, DJs, Sound Studios,home theaters with needs to organize Server/Network Equipment, Power Amplifiers, Microphones, DVD Players, Electronics etc. Compatible with ALL AxcessAbles rack drawers, shelves, rack accessories as well as all standard 19" rack accessories in the marketplace.

Before relying on a deployment, generate PDFs in the actual function rather than treating a local success as proof that Lambda behaves the same way. Include a cold-start check, verify that the function can reach the Google Fonts stylesheet and font-file host if you use remote fonts, and inspect the resulting page, header and footer. If those network requests are unreliable or unavailable in the function’s configuration, switch to a bundled font or change the network setup. The available documentation does not determine reachability for an individual Lambda deployment.

For operations, log failed request URLs and browser console errors without logging credentials or sensitive page content. Keep the fallback family in both page and template CSS. If consistent appearance across invocations is a requirement, prefer a controlled local asset and verify it in the same deployed Chromium build used for production.

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

Troubleshoot missing or incorrect fonts

  • The page body uses a fallback. Check whether the Google Fonts stylesheet request failed and whether the font-file request referenced by that stylesheet failed. Confirm the function can reach both URLs, and check that the CSS family name and requested weight match the stylesheet declaration.
  • The body is correct but the header or footer is not. Add the intended family and fallback inline in the template HTML. Do not assume page selectors or stylesheets carry over. Test whether the template can access the chosen font source in the deployed browser.
  • The PDF is generated before text appears ready. Keep waitForFonts: true explicit and bring a backgrounded page to the front before calling page.pdf() if the wait fails to resolve. Then inspect requests; a settled font set is not confirmation of a successful font download.
  • Only some characters are wrong or missing. Test the needed glyphs in the actual font file and fallback. A family may not contain every script or symbol used in the report; choose a font with the required coverage and test representative documents.
  • It works locally but fails on Lambda. Compare the deployed runtime, architecture, Chromium package, Puppeteer version, launch settings and network access with the local setup. Validate the compatible deployment as a whole rather than assuming the community Chromium package supports every pairing.
  • The render wait takes too long or never settles. Check failed and long-running page requests, and confirm whether the page is backgrounded. Network-idle navigation alone is not a font-success test; use a local font when dependence on a remote request is unsuitable.

Or skip the browser setup

If the job is to capture a webpage rather than to control a custom Puppeteer PDF header or footer, ScreenshotNeo offers a screenshot API and MCP server. It is not a drop-in replacement for the Puppeteer template code above: use Puppeteer when your PDF needs that exact custom template behavior. ScreenshotNeo can return a website screenshot or PDF from a request, without requiring you to operate this browser setup yourself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
TrueNAS Mini R - Rackmount ZFS Storage Server with 12 Drive Bays, 32GB RAM, Eight Core CPU, Dual 1/10 Gigabit Network (Diskless)
  • Performance-Oriented and Quiet Hardware Design: 32GB ECC RAM | 8-Core 2.2GHz Intel Atom CPU | 12x 3.5” Hot-Swap SATA Drive Bays | 2x RJ45 10Gigabit Ethernet LAN ports | Remote Management (IPMI) | 2x USB 2.0 Ports - 1x USB 3.0 Port | 1x Internal Boot Device | Built-in RAID | Boost performance by adding SSDs for read and write caching.
  • Ideal for file-sharing, backup, multimedia processing, transcoding, and distribution, video surveillance, edge/remote office, development, personal cloud, and other small/home office & SMB applications. Broaden your Mini’s capabilities with VMs and an extensive suite of software plugins.
  • TrueNAS software supports Windows, MacOS, Linux, and Unix clients and syncs with AWS, Azure, Dropbox and more. Supports NFS, SMB, AFP, iSCSI and S3 file sharing protocols. Use TrueCommand to manage multiple TrueNAS systems from a single interface.
  • Includes Short Rail Kit - 19" to 26.6" rackmount depth for short racks and optional rubber feet for desktop.
  • Item Weight: 41.7 lbs

One-call cURL example (see the ScreenshotNeo API 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 removes cookie and consent banners, newsletter popups and chat widgets before capture; those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. It also has an MCP server with take_screenshot, get_page_info and capture_pdf tools for AI agents. 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 to get 1,000 free screenshots a month with no card.

What to validate before shipping

  • Page CSS applies the intended font in print media and includes a generic fallback.
  • Header and footer templates specify their own inline family and fallback.
  • The PDF wait has settled, and logs show whether stylesheet or font-file requests failed.
  • Required glyphs render in body text and templates using the actual deployed font assets.
  • The Puppeteer, Chromium, Lambda runtime, architecture, packaging and network setup have been tested together in the target function.

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.

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