html2pdf.js is a client-side JavaScript library that converts HTML elements or strings into PDF documents entirely in the browser. It works by rendering the HTML to a canvas using html2canvas, then embedding that canvas image into a PDF generated with jsPDF. The library provides a Promise-based Worker API that allows chaining steps (from, toContainer, toCanvas, toPdf, save) and supports configuration of margins, page size, image quality, page breaks, and hyperlinks. It includes plugins for automatic page-break handling (CSS-based, legacy class-based, or avoid-all mode) and hyperlink extraction from anchor tags. The codebase is well-structured with a modular design, including a sophisticated DOM cloning utility (snapdom) that handles shadow DOM, canvas elements, iframes, and form controls. The project is actively maintained with CI/CD, semantic versioning, and visual diff testing.