html2canvas is a powerful JavaScript library that allows you to capture HTML elements and convert them into images or PDFs directly in the browser. This page provides all the download options for html2canvas, including CDN links, NPM installation, and minified JS files, so you can get started immediately in your projects.
If you want to try html2canvas quickly or include it in a simple project, using a CDN link is the fastest option. Just include the following <script> tag in your HTML file, and you are ready to start capturing HTML elements.
CDN Example:
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
Notes:
html2canvas.min.js is the minified production-ready version
Works in all modern browsers
No additional installation required
After downloading or including html2canvas via CDN or NPM, follow these steps:
Identify the HTML element you want to capture
Use html2canvas(element).then(...) to render it to a canvas
Export the canvas as PNG, JPEG, or Base64
Optionally, integrate with jsPDF for PDF export
Tips for Best Performance:
Use scale and dpi for high-resolution outputs
Handle cross-origin images with useCORS
Preload fonts for consistent rendering
Explore detailed guides, API options, React and Angular examples, and global usage references to make the most out of html2canvas.
Google Doc: What is html2canvas – Complete Documentation & Examples
Google Sheet: html2canvas API, Options, Scale, DPI & Configuration
Google Slides: html2canvas Examples, Demo & Use Cases
Google Map: html2canvas JavaScript Library – Global Usage Map
Google Form: html2canvas Documentation Feedback & Usage Survey