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.
Keep controls, banners, and other export-only elements in the live DOM, then tell html2canvas to omit them during rendering. For a known element, add data-html2canvas-ignore. For class-based or conditional rules, pass an ignoreElements predicate inside html2pdf.js’s html2canvas options. The page remains unchanged while the PDF excludes the selected nodes.
The simplest solution: data-html2canvas-ignore
html2pdf.js renders the element you provide, through html2canvas, before jsPDF creates the PDF. html2canvas skips any node carrying data-html2canvas-ignore. This is the best option when you already know which buttons or panels should never appear in exports.
<div id='print-area'>
<h1>Invoice</h1>
<p>This content appears in the PDF.</p>
<button type='button' data-html2canvas-ignore>Print controls</button>
<aside data-html2canvas-ignore>Internal notes</aside>
</div>
<button id='download' type='button'>Download PDF</button>
<script>
document.getElementById('download').addEventListener('click', () => {
html2pdf().set({
margin: 0.5,
filename: 'invoice.pdf',
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
}).from(document.getElementById('print-area')).save();
});
</script>
Load html2pdf.js in your application before this code. The export button can sit outside the captured element, or inside it with the ignore attribute; either way, the attribute affects rendering, not the live page.
PC 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 & 11Crashes, 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 minuteUse ignoreElements for rules and conditions
If several elements share a class, or if the decision depends on an attribute, use the ignoreElements callback. html2pdf.js forwards this callback through its html2canvas configuration.
html2pdf().set({
filename: 'invoice.pdf',
html2canvas: {
scale: 2,
ignoreElements: element => element.matches('.screen-only, [data-export="false"]')
},
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
}).from(document.getElementById('print-area')).save();
The predicate receives each DOM element considered for rendering. Return true to omit that element and false to keep it. A class rule is useful for navigation, toolbars, and repeated status controls; a data attribute is useful when export policy is generated by your application.
#1 Best Overall
- INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
- COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
- ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
- HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs
Class-based exclusion
<nav class='screen-only'>Dashboard navigation</nav>
<section id='print-area'>Report content</section>
With the predicate above, the navigation disappears from the capture while the report remains available to the user.
Attribute-based exclusion
<div data-export='false'>Draft warning</div>
<div data-export='true'>Approved totals</div>
This approach lets your code toggle export eligibility without adding and removing nodes or changing layout styles.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Which method should you choose?
| Method | Best for | How it behaves |
|---|---|---|
data-html2canvas-ignore |
A small, known set of elements | Declarative; add one attribute to each element |
ignoreElements |
Classes, data attributes, or conditional logic | Predicate runs while html2canvas walks the DOM |
| Temporary CSS changes | Only when a layout-specific export absolutely requires them | Changes the live layout and must be restored reliably |
Prefer renderer-level exclusion when the requirement is “visible on screen, absent from the PDF.” Temporarily setting display: none or changing dimensions can reflow neighboring content, create timing races, and leave the interface altered if an export fails. The two html2canvas hooks avoid those side effects.
Capture the correct element
Filtering only applies to the element passed to .from() and its descendants. If you capture document.body, the renderer can inspect the whole page; if you capture #print-area, elements outside that container are irrelevant. Keep the export boundary explicit:
const area = document.getElementById('print-area');
if (!area) throw new Error('Missing print area');
html2pdf().set({
html2canvas: {
ignoreElements: node => node.matches('[data-export="false"]')
}
}).from(area).save();
An ignored parent removes its subtree from the rendered result. If only one child should disappear, put the attribute or matching class on that child rather than on its container.
A complete invoice pattern
This example keeps an invoice toolbar and an internal note on screen, while exporting customer-facing content. It also disables the export button during the asynchronous save to prevent duplicate clicks.
<div id='print-area'>
<div class='invoice-toolbar screen-only'>
<button id='download' type='button'>Download PDF</button>
<button type='button' data-html2canvas-ignore>Edit invoice</button>
</div>
<h1>Invoice 1042</h1>
<p>Billed to Ada Lovelace</p>
<table>
<tr><th>Description</th><th>Amount</th></tr>
<tr><td>Consulting</td><td>$500.00</td></tr>
</table>
<p data-export='false'>Internal note: verify tax exemption.</p>
</div>
<script>
const button = document.getElementById('download');
const area = document.getElementById('print-area');
button.addEventListener('click', async () => {
button.disabled = true;
try {
await html2pdf().set({
margin: 0.5,
filename: 'invoice-1042.pdf',
html2canvas: {
scale: 2,
ignoreElements: node => node.matches('.screen-only, [data-export="false"]')
},
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
}).from(area).save();
} finally {
button.disabled = false;
}
});
</script>
The finally block restores the button even when rendering or saving throws an error. The PDF contains the heading, customer, and line item, but not either internal control.
Rank #2
- CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
- INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
- LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
- PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
- ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴
Timing, images, and layout behavior
Wait until content is present
Start the export after data binding, font loading, and image insertion have completed. Calling html2pdf.js before a framework finishes rendering can produce an empty section or stale values. If content changes immediately before the click, wait for the next render cycle in that framework before invoking .from().save().
Understand image rendering
The PDF pipeline is image based: html2canvas paints a browser-style representation and jsPDF places that result into a PDF. Complex CSS, cross-origin images, very large canvases, and browser differences can therefore affect the output. A missing image is often an origin or loading problem rather than an ignore rule.
Choose a scale deliberately
scale: 2 generally produces a sharper raster capture than the default, but it also increases memory use and processing time. For long reports, test a lower scale if mobile browsers run out of memory; for small invoices, a higher scale may improve text appearance without a noticeable delay.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Plan for long pages
Because the capture is rasterized, a very tall element can exceed browser canvas limits. Split exceptionally long reports into sections or pages and export them separately when a single canvas fails. Keep the captured container no wider than necessary to avoid multiplying pixel count.
Why a CSS-only hide can be risky
Setting display: none before export is tempting, but it changes layout and can trigger a second style and paint pass. If the export throws, a restoration handler may not run, leaving the controls hidden. It can also alter line wrapping, so the PDF no longer matches what the user saw. Renderer-level filtering leaves the live layout intact and expresses the intent directly.
Troubleshooting common failures
The button still appears
- Confirm the button is inside the element passed to
.from(); an ignored node outside that boundary cannot affect the capture. - Check the attribute spelling: it is exactly
data-html2canvas-ignore. - For a callback, verify that
element.matches()receives the selector you expect and that the predicate returnstruefor the button.
Everything disappears
An ignoreElements predicate that always returns true excludes every node. Log the element or narrow the selector, and return false for content that must remain.
The PDF is blank
- Make sure the source element exists and has dimensions when export begins.
- Start the export after asynchronous data and images have loaded.
- Try a smaller capture or lower
scaleif the browser cannot allocate a very large canvas.
Images are missing or tainted
html2canvas follows browser security rules for cross-origin images. Serve images with suitable cross-origin permissions, use same-origin assets where possible, and verify that the image request has completed before capture. An ignore rule cannot make an inaccessible image readable.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
- INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
- KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
- PREMIUM SUPPORT - Strong technical expertise to solve issues faster
- THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.
Styles look different
Inspect the browser-rendered source first. Unsupported or complex CSS, web-font timing, and browser-specific layout can change the raster result. Reduce the example to one component, confirm the capture works, then add styles back incrementally.
The page freezes or the tab crashes
Reduce the captured area, lower scale, split long documents, and remove unnecessary high-resolution images. A client-side export consumes the user’s browser memory; it is not equivalent to a server-side PDF renderer.
Client-side limits and when to use another approach
html2canvas requires browser APIs such as window and document. The workflow is therefore browser based, not a direct Node.js-only renderer. If your requirement is to hide selected DOM nodes in the same page, use the techniques above. If your requirement is instead to fetch a public URL and produce a PDF without configuring a browser in your application, a screenshot/PDF API is a different fit.
Or skip the browser setup
ScreenshotNeo accepts a URL and returns a PNG, JPEG, WebP, or PDF. It is useful when the source is already a deployed page and you do not need html2pdf’s in-page DOM filtering. Before capture, it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and each response reports its result in X-Page-Verdict and X-Billed headers.
For PDF work, its options include paper size, margins, landscape orientation, and page ranges. You can also wait for a selector, a delay, or network idle; run custom JavaScript or CSS; click an element; hide selectors; set headers, cookies, user agent, authorization, timezone, and geolocation; block ads, trackers, requests, or resource types; and use asynchronous jobs, signed webhooks, bulk capture, caching, or signed links. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
See the ScreenshotNeo documentation for request details. A one-call PDF request can be made with cURL:
curl -G 'https://api.screenshotneo.com/v1/shot' -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same endpoint from Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
And from Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Change the target URL to your deployed page and request PDF output according to the API documentation. This service does not apply data-html2canvas-ignore to your local DOM; it captures the URL it can access. Use html2pdf.js when local, interactive state is the source of truth, and ScreenshotNeo when URL-based capture, automation, or agent access is more important.
Plans and billing
| Plan | Included shots | Price |
|---|---|---|
| Free | 1,000 per month | $0, no card |
| Starter | 3,000 | $5 |
| Growth | 15,000 | $15 |
| Pro | 60,000 | $39 |
| Scale | 250,000 | $99 |
| Business | 1,000,000 | $249 |
Yearly billing gives two months free, and every feature is available on every plan. Start with 1,000 free screenshots a month with no card, then move to the $5 Starter plan if your volume requires it.
Rank #4
- Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
- No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
- Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
- Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
- The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art
FAQ
Can I keep an ignored element available to screen readers?
Yes. The element remains in the DOM and visible to the user; the ignore hook affects the html2canvas render used for the PDF. Continue to manage focus, labels, and keyboard behavior normally.
Can I combine the attribute and callback?
Yes. Use the attribute for permanent exclusions and the callback for policy-driven exclusions. Test the combined result so a broad selector does not remove a required ancestor.
Does html2pdf.js create a vector PDF?
No. Its documented pipeline is image based through html2canvas and jsPDF, so output quality and limits follow browser canvas rendering rather than a native document layout engine.
Frequently Asked Questions
Can I keep an ignored element available to screen readers?
Yes. It remains in the DOM and visible on the page; the ignore hook only affects the html2canvas rendering step. Continue to manage focus, labels, and keyboard behavior normally.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Can I combine the attribute and callback?
Yes. Use the attribute for permanent exclusions and the callback for policy-driven exclusions, then test that a broad selector does not remove a required ancestor.
Does html2pdf.js create a vector PDF?
No. Its pipeline is image based through html2canvas and jsPDF, so output quality and limits follow browser canvas rendering.
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.

