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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To download an HTML page as a JPG, render it in a browser and save a screenshot as JPEG. The image captures the page’s appearance, not its editable HTML source. For a one-time capture, use a browser screenshot; for repeatable jobs, Puppeteer can save directly as JPEG. html2canvas is another option, but it reconstructs the page from DOM and supported CSS rather than taking a true browser screenshot.

Choose the right way to turn HTML into JPG

Both a remote webpage and a local .html file must be rendered before they can be captured as an image. Choose based on whether you need a quick manual capture, repeatable automation, or an image generated inside the page itself.

Method Best for JPG output Main limitation
Browser screenshot One-off captures Chrome’s documented headless screenshot route saves PNG; convert it to JPG afterward. Manual steps or an extra conversion step.
Puppeteer Repeatable captures and scripts Set the screenshot type to JPEG and choose a quality value. Requires a Node.js project and a browser automation setup.
html2canvas Capturing a DOM element from page JavaScript Encode the canvas as JPEG, or convert a PNG result. Reconstructs from DOM and supported CSS; cross-origin restrictions can prevent assets from appearing.

A browser or Puppeteer screenshot aims to capture the rendered page. html2canvas is not a pixel-perfect screenshot engine: its project documentation says it builds an image from information available in the DOM, and unsupported CSS may differ from the browser’s display (html2canvas documentation).

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.

Save a page as JPG with a browser

For a single capture, open the page in a browser and use its screenshot capability or a browser screenshot tool. Set the viewport to the dimensions you need, then capture the visible area or the full page if the tool supports it. Chrome’s documented headless screenshot command saves a PNG, not a JPG, so convert that PNG to JPEG afterward if the file must be JPG (Chrome headless documentation).

#1 Best Overall
Brother Color Laser Printer with Wireless Printing Fast 19 PPM Output, Duplex Feature, Mobile Device Compatible, 250-Sheet Paper Tray for Professional Home Office Printing (HL-L3220CDW)
  • Professional Quality: Brother Genuine color laser printer delivers stunning business documents with crisp text and vibrant graphics at impressive 19 PPM speed, transforming your home office into a powerhouse of productivity
  • Wireless Connectivity: Brother Genuine advanced wireless capabilities enable seamless printing from laptops, smartphones, and tablets, with built-in security protocols safeguarding your sensitive business documents
  • High-Volume Capacity: Brother Genuine laser printer includes a generous 250-sheet paper tray minimizing refills, while the manual feed slot offers versatility for envelopes and specialty media
  • Efficient Performance: Brother Genuine automatic duplex printing saves time and paper, while delivering professional-quality double-sided documents at speeds up to 19 pages per minute
  • Mobile Integration: Brother Genuine technology ensures seamless compatibility with major mobile printing platforms and cloud services, enabling effortless document printing from your preferred devices

For a local file, open the HTML file in the browser and capture the rendered result. If it loads images, fonts, stylesheets, or scripts from the internet, the capture depends on those resources being available. If the page is long, a visible-viewport screenshot will not include content below the fold; choose a full-page capture where available or use Puppeteer’s full-page option.

Automate JPG capture with Puppeteer

Puppeteer controls a browser and provides page screenshot options including full-page capture, clipping to a region, image type, and JPEG quality. PNG is the default; specify JPEG explicitly when you need a JPG file (Puppeteer ScreenshotOptions). Install Puppeteer in a Node.js project, then save this as capture.mjs:

import puppeteer from 'puppeteer';

const url = process.argv[2];
if (!url) {
  throw new Error('Usage: node capture.mjs <URL>');
}

const browser = await puppeteer.launch({ headless: true });
try {
  const page = await browser.newPage({
    viewport: { width: 1440, height: 900 },
    deviceScaleFactor: 1
  });

  await page.goto(url, { waitUntil: 'networkidle2', timeout: 60000 });
  await page.screenshot({
    path: 'page.jpg',
    type: 'jpeg',
    quality: 85,
    fullPage: true
  });
} finally {
  await browser.close();
}

Run it with a remote URL:

node capture.mjs https://example.com

Or provide a local HTML file using a file URL, for example node capture.mjs file:///absolute/path/to/page.html. Use an absolute file path; relative file URLs can resolve differently depending on the working directory. The browser may not be able to load local resources if the HTML references paths that do not resolve from that file’s location.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Canon Color imageCLASS LBP646Cdw Wireless Laser Printer, Duplex, 26 PPM, Print Only, White
  • Single-Function, Color, Wireless, Duplex Printer: Print only. — No Scanning, Copying, or Faxing
  • Fast Print Speeds: Print up to 26 ppm in both color and monochrome and spend less time waiting with a quick first print time of approximately 10.3 seconds.
  • Easy Wireless Setup: Setup your wireless connection and get up and running in just a few steps.
  • 5-inch LCD Screen: Navigate through all the features using the 5-line LCD screen.
  • Mobile Device Printing: Print from your compatible mobile devices using the free Canon PRINT app, Apple AirPrint and Mopria Print Service.

Adjust the capture dimensions and region

  • Viewport: Change width and height to control the browser’s layout width and visible area. A narrower viewport may trigger a mobile layout.
  • Full page: fullPage: true captures the full document rather than only the current viewport. Very long pages may create large images.
  • Clip: For a specific rectangle, use Puppeteer’s clip screenshot option with the region’s coordinates and dimensions.
  • JPEG quality: The example uses quality: 85. Higher quality generally means a larger file; JPEG is lossy, so inspect text and fine detail at the quality you choose.
  • Wait behavior: The example waits for network activity to settle. Some sites keep connections open or load content later, so no single wait condition suits every page. For those pages, wait for a specific element or add an appropriate delay before capturing.

Puppeteer’s Page API documents navigation and screenshot methods; check the API documentation for behavior and options in the version installed in your project (Puppeteer Page API).

Capture an element with html2canvas

Use html2canvas when the capture should be initiated by JavaScript on the page, such as exporting one component. The library resolves a DOM element into a canvas, which can then be encoded as a JPEG and downloaded:

import html2canvas from 'html2canvas';

const element = document.querySelector('#capture');
if (!element) {
  throw new Error('Could not find #capture');
}

const canvas = await html2canvas(element, { scale: window.devicePixelRatio });
const link = document.createElement('a');
link.download = 'capture.jpg';
link.href = canvas.toDataURL('image/jpeg', 0.9);
link.click();

This requires the html2canvas package to be installed and available to your page’s JavaScript build. The project’s example demonstrates canvas download and supports cropping and scaling (html2canvas examples). Encoding to JPEG does not make the rendering identical to a browser screenshot; html2canvas still depends on the DOM properties and CSS it can interpret.

Rank #3
Sale
HP Color LaserJet Pro MFP 3301sdw | Color Printer | Wireless | All-in-One | Duplex
  • FROM AMERICA'S MOST TRUSTED PRINTER BRAND – Perfect for small teams printing, scanning and copying professional-quality color documents and reports. Print speeds up to 26 ppm black/color.
  • PROFESSIONAL PRODUCTIVITY – Proficiency with every print—next-generation TerraJet toner brings your business to life with more vivid colors.
  • ORIGINAL HP TONER CARTRIDGES – This HP printer uses Original HP 218A standard and 218X high yield LaserJet toner cartridges.
  • UPGRADED FEATURES – Fast color printing, scan, copy, auto 2-sided printing, auto document feeder, and a 250-sheet input tray.
  • AWARD-WINNING RELIABILITY – Performance you can count on page after page, and always ready for the high demands of business.

Browser security is an important constraint. A cross-origin image can taint the canvas, and a cross-origin iframe cannot be rendered by reading its content document. html2canvas states that it cannot bypass browser content policy restrictions (html2canvas Getting Started). If an asset is hosted on another domain, that server must permit access in a way compatible with browser CORS rules, or you may need a browser screenshot workflow instead.

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

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. Send one GET request to capture a URL as PNG, JPEG, WebP, or PDF. The service accepts cookie or consent banners as a visitor would, then removes more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with the outcome identified in response headers. An MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Here is a cURL call that saves a JPG:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -d format=jpeg -o shot.jpg

See the ScreenshotNeo API documentation for authentication and supported parameters. Sign up for 1,000 free screenshots a month with no card.

Troubleshoot missing or incorrect JPG captures

The file is PNG even though JPG was requested

Check the actual output format, not just the filename extension. Chrome’s documented headless screenshot route produces PNG. In Puppeteer, set type: 'jpeg'; for html2canvas, encode with image/jpeg or convert the PNG afterward. Renaming a PNG file to .jpg does not convert it.

Rank #4
Sale
Canon Color imageCLASS MF665Cdw - Wireless, All-in-One Duplex Laser Printer
  • Color, Wireless, Duplex 4-in-1: Print, scan, copy, fax.
  • Fast Print Speeds: Print up to 26 ppm in both color and monochrome and spend less time waiting with a quick first print time of approximately 10.3 seconds.
  • Easy Wireless Setup: Setup your wireless connection and get up and running in just a few steps.
  • 5-inch Color Touchscreen: Get the job done quickly with Application Library - an intuitive and easy to use customizable access to the features you use most.
  • Mobile Device Printing: Print from your compatible mobile devices using the free Canon PRINT app, Apple AirPrint and Mopria Print Service.

The page is blank or content is missing

  • Confirm the remote URL is reachable or the local file URL points to an existing file.
  • Wait for the specific content to load. A page may render its main layout before images or client-side content arrive.
  • Check whether the content appears only after scrolling, user interaction, or a delayed script. Use an element wait or an appropriate delay before the screenshot.
  • For a local file, verify that referenced assets use paths valid from the HTML file’s location.

Images or iframe contents are absent in html2canvas

Cross-origin assets may be unavailable to the canvas because of browser security policy. Cross-origin iframes cannot be read and rendered by html2canvas. Use assets served with appropriate cross-origin permission, capture the page through a browser screenshot, or omit the inaccessible element.

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

The output differs from the browser

If you used html2canvas, unsupported CSS or DOM features may explain the difference. For a closer match to the browser’s actual rendering, capture the page with Puppeteer or a browser screenshot feature instead. Also verify the viewport: responsive layouts can change substantially with width and height.

The capture cuts off the page or is unexpectedly large

A regular screenshot may capture only the viewport. Enable full-page capture if the tool supports it, or capture specific regions with clipping. Full-page captures of very long documents can produce large files; reduce the viewport’s device scale factor or output dimensions when detail requirements allow.

Best Value
Brother MFC-L3720CDW Wireless Color Laser Printer, Scanner, Copier, Fax, Auto Duplex, 250-Sheet Capacity
  • Professional Performance: Dominate your business printing with this Brother Genuine color laser printer delivering exceptional print speeds up to 19 ppm and stunning laser-quality output that makes your documents stand out from the competition
  • Advanced Connectivity: Take command of your workflow with dual-band wireless networking (2.4GHz/5GHz), Wi-Fi Direct, and USB 2.0 interface, enabling multiple users to connect and print seamlessly from any device in your office
  • Productivity Powerhouse: Maximize efficiency with the 50-sheet auto document feeder, 250-sheet adjustable paper tray, and automatic duplex printing, ensuring uninterrupted performance for your demanding business needs
  • Smart Integration: Transform your workflow with the intuitive 3.5" color touchscreen featuring 48 customizable shortcuts and direct access to popular cloud services including Google Drive, Dropbox, and OneNote for seamless document management
  • Mobile Command Center: Leverage the power of mobile printing with remote access capabilities, toner level monitoring, and complete printer management directly from your mobile device through the exclusive companion app
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Practical notes on quality, reliability, and cost

  • Format: JPEG is useful when a JPG deliverable is required, but it is lossy. Keep a PNG master when sharp text, transparency, or repeated editing matters; JPEG does not preserve transparency.
  • Repeatability: Puppeteer lets you fix viewport size and screenshot settings, making repeat jobs more consistent. Page content can still change with time, authentication, location, or external resource availability.
  • Waits: A longer timeout does not guarantee that a page has finished rendering. Prefer waiting for a meaningful selector where possible; network-idle waits can be unsuitable for pages with persistent network connections.
  • Privacy: A browser screenshot can be run locally. For a hosted API, consider whether the target page contains sensitive information and review the service’s terms before sending it.
  • Cost: A local browser workflow uses your machine and project dependencies. ScreenshotNeo’s stated plans include 1,000 monthly free shots without a card, then paid tiers from $5 for 3,000; yearly billing gives two months free, and every feature is available on every plan.

Frequently Asked Questions

Does downloading HTML to JPG save the HTML code?

No. A JPG contains a rendered visual image; it does not preserve editable markup, styles, or page behavior.

Can a JPG have a transparent background?

No. JPEG does not support transparency. Use PNG or another format that supports an alpha channel if transparency is required.

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

Can I convert a private local HTML file?

Yes. Open it in a browser or navigate Puppeteer to a file URL on your machine. Its referenced local assets must resolve correctly.

Quick Recap

SaleBestseller No. 2
Canon Color imageCLASS LBP646Cdw Wireless Laser Printer, Duplex, 26 PPM, Print Only, White
Canon Color imageCLASS LBP646Cdw Wireless Laser Printer, Duplex, 26 PPM, Print Only, White
5-inch LCD Screen: Navigate through all the features using the 5-line LCD screen.; Paper Capacity: 250-sheet standard cassette, 1-sheet multipurpose tray.
$229.00
SaleBestseller No. 4
Canon Color imageCLASS MF665Cdw - Wireless, All-in-One Duplex Laser Printer
Canon Color imageCLASS MF665Cdw - Wireless, All-in-One Duplex Laser Printer
Color, Wireless, Duplex 4-in-1: Print, scan, copy, fax.; Paper Capacity: 250-sheet standard cassette, 1-sheet multipurpose tray.
$389.00

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.