Recommended Free Tools
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To convert an element already displayed in a web page, render it to a canvas with html2canvas, then export that canvas as JPEG with canvas.toBlob() or canvas.toDataURL(). This is a DOM-based reconstruction, not a pixel-for-pixel browser screenshot. If you need the browser’s rendered output, use Playwright; if you need a remote URL captured without running a browser yourself, use a hosted screenshot service such as ScreenshotNeo.
Choose the right JavaScript approach
The right method depends on where the HTML lives and how closely the JPG must match what a browser actually displays.
| Approach | Best fit | What it renders | Main constraint |
|---|---|---|---|
| html2canvas | Exporting a component or section from the page currently open in a user’s browser | A canvas reconstructed from DOM information and supported styles | Some CSS, cross-origin images, and inaccessible frames may be missing or prevent export |
| Playwright | Automated capture where a real browser should render the page | The browser-rendered page or selected element | Requires browser automation setup and execution in a supported environment |
| ScreenshotNeo | Capturing a remote URL or generating screenshots through a hosted API | A page loaded by the service’s browser | Requires an API key and a network request |
For a client-side export button, start with html2canvas. For a URL on another domain, do not expect code running in your page to bypass browser same-origin protections: use an automated browser or hosted capture service instead.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Convert a page element to a downloadable JPG with html2canvas
The code below captures an element with ID receipt, converts its canvas to JPEG, and triggers a download. It uses toBlob() to avoid building a large base64 string in JavaScript memory.
#1 Best Overall
- User-Friendly Portable Photo Printer for iPhone, Android & PC - Get beautiful and colourful memories with Liene 4x6 photo printer! After opening the entire package, you can find one cartridge + 20 sheets of photo paper (placed inside the machine packaging), as well as an additional box containing 80 sheets of photo paper (which includes two cartridges + 80 sheets of photo paper). Full package includes smartphone photo printer, Liene 4x6 photo printer papers (100 sheets), 3 colour cartridges, and fully sealed cassette to prevent dust. Minimalist and magnetic design for compact storage.
- Superior Quality 4x6 Photo Printer - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Clean the print head promptly if smudges are observed on printed photos during operation. Get Liene photo printers now for yourself and your loved ones, print your happy moments together and keep your love forever!
- Wi-Fi Photo Printer for Smartphone - The built-in hotspot of the photo printer makes it easy to print pictures from your phone, avoiding outside interference with a fast and stable connection. No other networks required! Simply connect your device to the independent instant photo printer 4x6 hotspot.
- Multiple Device Compatibility - Liene phone printer provides instant photo printing for up to 5 simultaneous connections. Share with family and friends or print from your different devices. No additional cables or Bluetooth required when printing photos with this picture printer. Note: Ensure the ink cartridge clicks into place before printing.
- Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Square border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this photo printer for iphone 4x6 prints.
- Install or include html2canvas using the project’s current installation instructions.
- Put the content you want to export inside an element with a stable selector such as
id="receipt". - Call
html2canvas(), then export the returned canvas as JPEG and download the resulting blob.
import html2canvas from 'html2canvas';
async function downloadElementAsJpg() {
const element = document.querySelector('#receipt');
if (!element) {
throw new Error('Could not find #receipt');
}
const canvas = await html2canvas(element, {
backgroundColor: '#ffffff',
scale: window.devicePixelRatio || 1
});
const blob = await new Promise((resolve, reject) => {
canvas.toBlob((result) => {
if (result) resolve(result);
else reject(new Error('JPEG export failed'));
}, 'image/jpeg', 0.9);
});
const link = document.createElement('a');
const objectUrl = URL.createObjectURL(blob);
link.href = objectUrl;
link.download = 'receipt.jpg';
link.click();
URL.revokeObjectURL(objectUrl);
}
Call downloadElementAsJpg() from a user action, for example a button click. The 0.9 value is JPEG quality on the browser’s 0-to-1 canvas export scale; higher quality generally produces a larger file. JPEG does not preserve transparency, so this example sets a white background. If the captured content needs transparent pixels or lossless output, export PNG instead.
The official html2canvas examples demonstrate selecting an element, awaiting the resulting canvas, and exporting it as an image. Its documentation cautions that the output is built from DOM information rather than taken as a literal screenshot, and that some CSS properties are unsupported. See the html2canvas documentation and examples.
Use a download link instead of triggering a click
If you want the user to choose when to save the file, keep the object URL alive and expose it in a link:
Free tools Windows power users keep installed
One-click scans. No signup required.
const link = document.querySelector('#download-jpg');
link.href = URL.createObjectURL(blob);
link.download = 'receipt.jpg';
link.hidden = false;
Revoke the object URL when it is no longer needed, such as after the user has downloaded the image or when replacing the link. Do not revoke it immediately after assigning it if the link must remain usable.
Rank #2
- Dock Photo Printer: The KODAK Dock Plus is a home photo printer that produces high-quality 4x6” prints directly from compatible smartphones. Featuring an integrated docking station, users can place their phone on the printer for better connection while simultaneously charging the device during printing.
- Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
- Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Dock Plus is built for straightforward operation, making it ideal for first time users and everyday photo printing.
- Home Printing Station: Designed for stable desktop use, this dock photo printer connects to a power outlet for consistent performance and larger 4x6” prints. Ideal for home printing, photo albums, framing, family events, and everyday picture printing.
- KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.
Capture the entire document or adjust the output size
To attempt a full-document render with html2canvas, pass the document element rather than a component:
const canvas = await html2canvas(document.documentElement, {
backgroundColor: '#ffffff',
scale: 1,
windowWidth: document.documentElement.scrollWidth,
windowHeight: document.documentElement.scrollHeight
});
Full-page capture can create a very large canvas, especially at a high scale. A larger scale increases pixel dimensions and memory use. Choose a scale that suits the image’s intended display size; use a smaller scale for compact previews and a higher scale when sharper output is worth the extra memory and file size. Browser canvas limits vary, so exceptionally tall or wide pages can fail or produce incomplete output.
For a specific component, pass the element itself. If you want only a region within it, crop the resulting canvas before exporting:
const cropped = document.createElement('canvas');
cropped.width = 800;
cropped.height = 400;
cropped.getContext('2d').drawImage(canvas, 100, 50, 800, 400, 0, 0, 800, 400);
The source rectangle arguments are the area to copy from the original canvas; the final arguments are the destination size. Check dimensions before drawing, because a crop extending outside the rendered canvas will not produce the region you expect.
Rank #3
- 2x3" Portable Photo Printer: The upgraded PP01 photo printer uses advanced inkjet technology. This portable photo printer produces vivid, full-color prints on premium sticky-backed photo paper that is smudge-proof, water-resistant, and tear-resistant. The Nelko mini photo printer is pocket-sized and weighs only 308g, making it ultra-portable for school, travel, and field trips. Each ink cartridge prints up to 80 full-color 2x3 photos on sticky-backed paper
- Easy Printing via Bluetooth: The PP01 mini photo printer is compatible with iOS and Android phones via Bluetooth. Simply download the Nelko app from Google Play or the App Store. Load the 2x3 photo paper with the smooth side facing down. Install the ink cartridge, connect via Bluetooth, and print directly using the Nelko app. A USB charging cable is included; the adapter is not included
- High Photo Quality: This mini photo printer uses advanced inkjet technology for clear, vibrant prints. This portable photo printer produces 600 DPI high-resolution images with precise colors, capturing fine details and realistic tones. Each photo comes with adhesive backing, perfect for scrapbooks and preserving your memories. Personalize every photo for holidays, birthdays, or daily events
- Powerful App: The Nelko 2x3" PP01 photo printer app lets you edit photos and offers a variety of frame designs, making it perfect for personalizing your photos for projects like scrapbooking or journaling. Download the Nelko app to create collages and customize photos with filters, graffiti, borders, stickers, text, AI image editing, and many other features. Edit photos on your phone, then send them to the Nelko app for instant printing in under 90 seconds
- Versatile Usage Scenarios: This portable photo printer is ideal for travel journals, party favors, and family gatherings. Students use it for planners and photo printing. Crafters use it for DIY projects, custom labels, and scrapbooking. It's a practical tool for bloggers, small businesses, and event photographers to create instant giveaways. Perfect for Mother's Day surprises and heartfelt moments with loved ones using Nelko sticky-backed photo paper.
Use Playwright when you need a real browser screenshot
Playwright’s screenshot API captures the page as rendered by its browser and supports JPEG output, a quality value from 0 to 100, and scale controls. This is generally a better fit for automated jobs or content that relies on browser rendering than a DOM-to-canvas reconstruction. The example below is an ES module script for Node.js.
import { chromium } from 'playwright';
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width: 1280, height: 900 } });
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({
path: 'page.jpg',
type: 'jpeg',
quality: 85,
fullPage: true,
scale: 'css'
});
} finally {
await browser.close();
}
Install Playwright and its required browser using the current Playwright installation guide. In the API, JPEG quality is documented from 0 to 100, with a default of 80. fullPage: true captures the full scrollable page; omit it to capture the viewport. Playwright also supports capturing a particular element via its locator screenshot API. See the page screenshot options.
Readiness needs depend on the page. If a chart, font, image, or client-side render appears late, wait for the page-specific condition before taking the screenshot—for example, a visible selector or application event. A generic network-idle signal is not proof that every animation or delayed widget has finished.
Or skip the browser setup
For a remote URL, ScreenshotNeo provides a screenshot API that returns an image or PDF. This one-request example saves a WebP image; change the output format using the service’s documented parameters.
Rank #4
- Dual 4x6" & 3x3" Photo Printer Paper Tray Convenience: Seamlessly print both 6-inch standard photo paper and 3-inch sticky-backed paper with our innovative dual tray design. This compact phone photo printer for smartphone offers easy storage and quick access, making it perfect for diverse printing needs without taking up much space. Enjoy vibrant, high-quality prints every time.
- Fast Bluetooth Connectivity: Experience lightning-fast printing with our liene photo printer's Bluetooth connection, which pairs in just 13 seconds. Enjoy a seamless and efficient printing experience, perfect for capturing and sharing memories on the go without the hassle of cables or complex setups.
- Superior Quality Photo Printer 4x6 - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Get Liene photo printers now as amazing gifts for yourself and your loved ones, print your happy moments together and keep your love forever!
- Multiple Device Compatibility - Liene picture printer for iphone provides instant photo printing for up to mutiple simultaneous connections. Share with family and friends or print from your different devices. No additional cables required when printing photos with this phone printer.
- Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Polaroid border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this iphone photo printer for 4x6 & 3x3 prints.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for the request options. Before capture, it can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status. Its 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 without a card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo to try 1,000 screenshots a month free, with no card required.
Cross-origin assets and canvas export failures
Canvas security rules are the most common source of confusing export problems. html2canvas can only draw external images that the browser allows the page to read. Its useCORS option can attempt a CORS-enabled image load, but it cannot grant permission that the image server has not provided. A canvas containing a disallowed cross-origin image becomes tainted, and browser export methods such as toBlob() or toDataURL() can throw a security error.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11- Serve the image from the same origin as the page, or configure the image host to return appropriate CORS headers.
- Use a trusted server-side proxy only where you control access and have a valid right to retrieve the image; do not create an open proxy.
- Do not expect a cross-origin iframe’s contents to be captured by html2canvas. The parent page cannot freely inspect that frame’s document.
- Test every external asset path in the browser console and verify the resulting JPG rather than assuming a successful promise means every asset was included.
These limits are browser security boundaries, not a setting that can be overridden by adding useCORS: true. The project documents both the CORS caveat and the inability to render cross-origin iframe content in its documentation.
Prepare content for a more reliable capture
Capturing immediately after navigation or a state change can produce an image before the page is visually ready. There is no universal readiness condition that guarantees all sites have finished rendering, so wait for the conditions your own page needs.
Best Value
- Instant Photo Printing: The KODAK Mini 2 Retro is a portable photo printer designed to turn smartphone pictures into high quality prints in seconds. Whether capturing family moments, travel highlights, journaling pages, or creative projects, this mini printer lets you print real photos anytime, anywhere.
- Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
- Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Mini 2 Retro is built for straightforward operation, making it ideal for first time users and everyday photo printing.
- Print Anytime, Anywhere: Small enough to fit in your hand, bag, or even a pocket, the Mini 2 Retro is built for on-the-go printing. Ideal for parties, trips, school projects, scrapbooks, and spontaneous moments where you want real prints without waiting.
- KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.
- Wait until the target element exists and contains its final content.
- Wait for images to load; for pages you control, use the image elements’
decode()promises where appropriate. - Ensure web fonts have loaded before capturing text-heavy layouts.
- Pause or finish animations if the image should show a stable state.
- Set a background color explicitly when exporting JPEG, which has no transparency.
- Keep the capture area and scale within reasonable canvas dimensions to avoid memory pressure.
For Playwright or a hosted URL capture, use a selector wait or an application-specific readiness signal when available. A fixed delay can be a fallback for pages that expose no reliable signal, but it adds latency and still cannot guarantee readiness on every run.
Troubleshooting HTML-to-JPG conversion
| Symptom | Likely cause | What to do |
|---|---|---|
document.querySelector() returns null |
The selector is wrong or the element has not been rendered yet | Check the selector in DevTools and wait until the component is mounted before capturing. |
| External images are missing | The image host blocks cross-origin reads or the resource has not loaded | Use same-origin images or configure correct CORS response headers; wait for loading to complete. |
toBlob() or toDataURL() throws a security error |
A cross-origin image tainted the canvas | Fix image CORS or remove the inaccessible image from the capture; a client-side option cannot bypass browser security. |
| Fonts, shadows, or layout differ from the page | html2canvas reconstructs the DOM and does not support every CSS feature | Check the project’s supported features; use Playwright if actual browser-rendered output is required. |
| Output is blank or incomplete | Capture occurred before content loaded, the selector is wrong, or page size exceeded practical canvas limits | Wait for content, verify the target, and try a smaller region or lower scale. |
| JPEG looks soft or is unexpectedly large | Scale or quality is mismatched to the intended display size | Adjust the canvas scale and JPEG quality; inspect the pixel dimensions and resulting file size. |
| Remote URL cannot be loaded by browser-side code | The page is outside the current page’s origin or is subject to browser security restrictions | Navigate to it in Playwright or submit the URL to a hosted screenshot API. |
| Playwright screenshot misses a delayed widget or chart | The capture ran before the page-specific visual state was ready | Wait for a selector, event, or other application readiness signal instead of relying only on navigation completion. |
Cost, performance, and output choices
html2canvas avoids a separate browser service, but it performs DOM traversal and canvas rendering on the user’s device. Large captures consume memory and may temporarily affect responsiveness. Reducing capture area and scale is often the simplest way to control that cost. JPEG quality trades file size against image detail; use a white or other solid background when transparency is not needed.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Playwright shifts work to an automated browser environment and provides browser-rendered output, at the cost of installing and running browsers. A hosted API moves browser operation to a service and is suited to remote URL capture, but introduces an API key, network dependency, and service pricing. ScreenshotNeo’s published plan limits are monthly: Free includes 1,000 shots; Starter is $5 for 3,000; Growth is $15 for 15,000; Pro is $39 for 60,000; Scale is $99 for 250,000; Business is $249 for 1,000,000. Yearly billing gives two months free, and every feature is on every plan. Check the service’s current documentation for request behavior and options.
Which method should you use?
- Choose html2canvas for an export button that captures a same-page element and where close-enough DOM reconstruction is acceptable.
- Choose Playwright when you need the browser’s rendered result, automated capture, or a page/element screenshot in a browser workflow.
- Choose a hosted API when the input is a remote URL and you do not want to operate the capture browser yourself.
Frequently Asked Questions
Can html2canvas convert HTML directly into a JPG file?
It returns a canvas, not a file. Export that canvas with a JPEG canvas method such as toBlob() or toDataURL('image/jpeg').
Can I capture a website on another domain with html2canvas?
Not by loading that site’s document from an unrelated page. Browser origin restrictions prevent that; use browser automation or a hosted URL-capture service.
Does html2canvas produce an exact screenshot?
No. It reconstructs an image from DOM information and supported CSS, so it may differ from the browser’s actual rendered pixels.
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.

