Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › GST invoice

Puppeteer Screenshot of a GST Invoice: Wait for Totals to Load

By Freedom251 Team · · 5 min read

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

Wait for the invoice’s totals to reach a known, page-specific ready state before taking the screenshot. A fixed delay or quiet network is not proof that GST calculations have finished. The example below checks that a total is populated and the totals-loading indicator is gone; replace its selectors and completion test with the ones used by your invoice page.

Wait for the invoice state, not an arbitrary delay

Invoice pages can render before their data is ready, and totals may update after the initial markup appears. A reliable capture should wait for a condition that represents the invoice values you intend to show: for example, the expected total is present and a known loading indicator has disappeared. An element merely existing in the DOM is not necessarily finished calculating.

As an Amazon Associate I earn from qualifying purchases.

Puppeteer’s locator guidance describes waiting for elements to be present and in the right state, and demonstrates function-based conditions for page content. Adapt the condition to your invoice’s actual markup and definition of “loaded.” Puppeteer page interactions guide; Puppeteer Page API.

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

Runnable example: wait for populated totals, then capture

This Node.js example assumes your page has a total element with data-testid="invoice-total" and a loading element with data-testid="totals-loading". Those are illustrative selectors, not Puppeteer defaults. Replace them with stable selectors from your invoice application.

#1 Best Overall
Sale
Rongta 80mm Thermal POS Receipt Printer Black | 3 1/8 inch Pos Printer with Auto Cutter, USB, Serial, Ethernet, for Kitchen
  • Auto Cutter and High-Speed Printing: The thermal receipt printer features high efficiency with auto cutter and the fastest printing speed of 300mm/sec. Easy for paper installation, easy maintenance, and excellent structure. Plug and play USB PORT, easy to use. Three Interface ports: USB+ LAN + SERIAL PORT. Does NOT support Wifi or Bluetooth. Compatible with WIN2003/WINXP/WIN7/WIN8/WIN10/LINUX/Mac
  • Wall Hanging Design: Kitchen printer with two hanging holes on the bottom support wall mount hanging. Easy to use, save the place. With auto cutter and compatible with several operating systems. Print width: 79.50.5mm; Paper Width: 3 1/8 inch (80mm)
  • Wide Compatibility and Reasonable Design: Desktop or wall-mounted type for option, lets you use every space more rationally. The humanized auto-cutter ensures the receipt will not fall to the ground after printing. One-button open cover and large paper warehouse design, easy to use and maintain. Works with MUNBYN 3 1/8 x 203ft thermal paper and Gorilla 3 1/8 x 230 Thermal Paper Receipt Rolls
  • Cost-Effective Operation: Supports cash drawer driving, compatible with ESC/POS print commands. The network receipt printer does not need ribbon or ink cartridge, resulting in low operating cost. The printer has the function of overheating protection for long service life. Printing characters with high speed and reliable performance for receipt printing in large shopping malls, supermarkets, retail, hotels, canteens, and restaurants
  • Compatibility Notice: The receipt printer is not compatible with Grubhub, Doordash, Square, Chromebook, Uber, or Clover systems. Rongta is a brand dedicated to offering high quality products and good shopping experience for customers
const puppeteer = require('puppeteer');

(async () => {
  const invoiceUrl = 'https://example.com/invoice/123';
  const browser = await puppeteer.launch({ headless: true });

  try {
    const page = await browser.newPage();
    await page.goto(invoiceUrl, { waitUntil: 'domcontentloaded' });

    await page.waitForFunction(() => {
      const total = document.querySelector('[data-testid="invoice-total"]');
      const loading = document.querySelector('[data-testid="totals-loading"]');
      return total && total.textContent.trim() !== '' && !loading;
    }, { timeout: 15_000 });

    await page.screenshot({ path: 'gst-invoice.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

Install Puppeteer in your project with npm install puppeteer, save the example as a JavaScript file, and run it with Node.js. Use an invoice URL and selectors you are authorized to access. The finite wait means a condition that never becomes true throws a timeout instead of silently producing a potentially incomplete image.

Make the readiness condition meaningful

The sample treats any non-empty total text as ready. For a production invoice, strengthen that check to match the application’s real completion signal: verify expected currency formatting, a known final value when appropriate, all relevant subtotal/tax/total fields, or a state attribute that the application sets only after calculation. If totals can change after first appearing, non-empty text alone is insufficient; wait for the final or settled state your app exposes.

Rank #2
Sale
Rongta POS Printer, 80mm USB Thermal Receipt Printer,Black | Restaurant Kitchen Printer with Auto Cutter Support Cash Drawer,USB Serial Ethernet Interface for Windows/Mac/Linux (RP326)
  • 【Fast Printing & Auto Cutter】The pos printer high efficiency with auto cutter and printing speed--250mm/sec. Easy for paper installation, easy maintenance, easy to use.Three Interface ports:USB+ LAN + SERIAL PORT.DO NOT-Wifi-Bluetooth.
  • 【Wall Hanging Design】 Kitchen printer with two hanging holes on the bottom support wall mount hanging. Easy to use, save the place. With auto cutter and compatible with several operating systems. Print width:79.5±0.5mm; Paper Width:3 1/8" (80mm).
  • 【Wide Compatibility&Reasonable Design】Desktop or wall-mounted type for option, lets you use every space more rationally. The humanized auto-cutter, the receipt will not fall to the ground after printing. One-button open cover and large paper warehouse design, easy to use & maintain. Work with MUNBYN 3 1/8 x 203ft thermal paper,MFLABEL thermal receipt paper.
  • 【Most Cost-effective】Support cash drawer driving, compatible ESC/POS print commands.Do not need ribbon/ink cartridge, low operating cost. The printer has the function of overheating protection, long service life. Printing characters with high speed, reliable performance.It is an ideal choice for receipt printing in large shopping malls, supermarkets, retail, hotels, canteens, restaurants, etc.
  • 【Buy with Confidence】 Rongta is a brand that is dedicated to offering the highest quality products and good shopping experience for the customer. Warm tips:The receipt printer is not compatible with Ubereats/Grubhub/Doordash/Lightspeed/Postmates/Square/Chromebook/Clover.

If totals are updated by a known API response, Puppeteer’s waitForResponse() can help synchronize with that response. Still check the rendered totals before capture: a successful response alone does not prove the page has displayed the corresponding values. The Page API also documents waitForSelector() with visibility options and waitForFunction() for a truthy page condition. Puppeteer Page API.

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

Choose the right capture area

Use a full-page screenshot when the whole invoice, including its identifying details and line items, needs to be visible. Puppeteer’s Page.screenshot() supports page capture. If the task is specifically to inspect the calculated amounts, capture the totals element instead; Puppeteer documents ElementHandle.screenshot() for a focused element capture. Puppeteer screenshots guide.

Rank #3
Star Micronics TSP143IIIU USB Thermal Receipt Printer with Device and Mfi USB Ports, Auto-Cutter, and Internal Power Supply - Gray
  • High-speed printing of 43 receipts per minute (250mm/s) with easy to setup USB connection - just Plug and Print; USB serial number feature means the PC will detect the TSP143IIIU on its Windows platform using any USB port
  • Compatible with iOS, Android, and Windows for a simple setup process
  • The "Drop-In and Print" clamshell design allows for fast and easy paper loading; patented "De-Curl" function always delivers a flat receipt
  • The TSP143IIIU USB model is certified with the following companies: Postmates, Square, Chromebook, and Clover
  • The small footprint and embedded power supply saves precious counter space
// Full invoice
await page.screenshot({ path: 'gst-invoice.png', fullPage: true });

// Focused totals region
const totals = await page.$('[data-testid="invoice-totals"]');
if (!totals) throw new Error('Invoice totals region was not found');
await totals.screenshot({ path: 'gst-totals.png' });

As with the total selector in the wait condition, [data-testid="invoice-totals"] is an example. Choose a selector that uniquely identifies the intended region.

When network idle helps—and when it does not

waitUntil: 'networkidle2' is available as a navigation wait condition, and Page.waitForNetworkIdle() waits for network activity to become idle for at least the configured idle period. This can be useful as a supplementary settling step when the page depends on network-loaded resources. Puppeteer screenshots guide; Page.waitForNetworkIdle API.

Rank #4
Volcora Thermal Receipt Printer, 80mm POS Printer w/Auto Cutter, USB/Ethernet Interface for Windows/MAC/Linux, ESC/POS Command Support Cash Drawer, High Speed Kitchen Printer, Wall Mount (Black)
  • Compatibility Information: Please ensure that our receipt printer is compatible with your device.The Ethernet interface supports Windows, Mac OS, Linux, VirtualCom, Android, RaspberryPi and iOS. But the USB interface could only support Windows, Mac OS, Linux, VirtualCom and Android. Additionally, it does not support Ubereats, Grubhub, Doordash, Postmates, Clover, or Shopify for POS software.
  • Fast Printing & Auto Cutter: This high-efficiency thermal receipt printer boasts a maximum printing speed of 260mm/s, ensuring quick and efficient printing without any paper jams. The automatic cutter is designed to handle heavy usage and can last up to 1.5 million cuts. With a one-button open cover and a spacious paper warehouse, this POS printer is easy to use and maintain. Additionally, the receipt printers utilizes direct thermal printing technology, eliminating the need for ribbons or ink.
  • USB & Ethernet Interface: The receipt printer has USB and Ethernet interfaces, as well as cash drawer RJ11 ports. However, it does not support Bluetooth or WiFi printing. With a 203 dpi resolution, the Ethernet receipt printer produces high-quality prints that are sharp and clear. To develop custom applications on Ethernet-supported systems like iOS and Android, a software development kit (SDK) is necessary.
  • Wall Mount Option: The kitchen printer has a wall mount option with two hanging holes at the bottom, allowing it to easily fit into any space. This USB receipt printer is an excellent choice for various establishments such as restaurants, kitchens, retail stores, grocery stores, clothing stores, supermarkets, cafes, ticket points, food trucks, banks, shopping malls, hotels, canteens, and more.
  • Customer Service in the United States: Our team of customer support based in the United States is ready to help you with any problems you may have regarding the integration of the direct thermal printer. Whether you require assistance with setup, connection, compatibility, or any other issues related to the product, please don't hesitate to reach out to us. Additionally, all Volcora products are backed by a limited lifetime warranty, ensuring your peace of mind when making a purchase.

Network quiet is a transport signal, not verification that the invoice is correct or that totals have finished rendering. A page may have no active requests while JavaScript is still recalculating or updating the displayed values. Make the invoice-specific condition the primary gate; add a network-idle wait only if it addresses a known part of the page’s loading behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Application-state wait versus network-idle wait

Wait strategy What it tells you Best use Limitation
Application-state condition A page-specific selector or function reports that the relevant totals are ready. Primary gate before capturing calculated invoice values. Requires stable page markup and a correct definition of completion.
Network idle Network activity has been quiet for the configured idle period. Optional support when network-loaded resources need time to settle. Does not independently confirm that displayed totals are populated or final.

Troubleshoot incomplete or failed captures

  • The wait times out: Confirm the selector matches the live page and is not inside an iframe. Check whether the loading indicator is removed, hidden, or replaced with another state; update the condition accordingly. Treat the timeout as a failed capture and investigate rather than saving it as complete.
  • The screenshot shows a placeholder or intermediate amount: Your condition may only check that the element exists or contains any text. Check the actual final-state signal, including all totals that matter, and wait for the application’s calculation to settle.
  • Network idle happens but totals are still wrong: Network quiet does not establish calculation completion. Keep the application-state check and use network idle only as a secondary wait.
  • The totals-only screenshot fails: Verify the element selector and ensure the element exists after the readiness condition. If the totals are inside a nested frame or shadow DOM, use the appropriate frame or page-specific selection approach rather than assuming a top-level selector will find them.
  • The capture is clipped or omits invoice content: Use a full-page screenshot for the whole invoice, or target the correct totals container for a focused capture. Check that the chosen element is the region you intend to save.

Or skip the browser setup

If you want a screenshot without maintaining a Puppeteer browser flow, ScreenshotNeo accepts one GET request with a URL and returns an image or PDF. Its API documentation describes the available parameters; this example requests a WebP screenshot:

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

ScreenshotNeo removes cookie banners, newsletter popups and chat widgets before capture, and failed loads, bot checks and blank pages are not billed. It also offers an MCP server so AI agents can take screenshots. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. For GST totals that depend on an application-specific calculation, confirm that the returned screenshot shows the final values you need.

Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.

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.

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.

GST invoiceNode.jsPuppeteerscreenshotsweb automation

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.