Convert Word documents to PDF in your browser. Mammoth.js extracts the structure, html2pdf renders it.
Mammoth.js maps Word styles to semantic HTML (h1/h2/h3, paragraphs, lists, tables, images). html2pdf then renders that HTML to a PDF using the browser's print engine. Formatting will be close but not pixel-identical — fonts may substitute, page breaks may shift, headers/footers don't round-trip. For 100% fidelity, open the file in Word and use "Save as PDF" there.