HTML Files to PDF
import {PdfDocument} from "@ironsoftware/ironpdf";

(async () => {
    // Render the HTML file
    const pdf = await PdfDocument.fromHtml("example.html");

    // Export the PDF document
    await pdf.saveAs("output.pdf");
})();
npm i @ironsoftware/ironpdf
HTML Files to PDF

HTML Files to PDF

Convert HTML to PDF using IronPDF

To convert an HTML file to a PDF document, you can use the fromHtml method provided by the IronPDF library from Iron Software. The resulting PDF will include the complete content from your HTML file.

Discover More with Our HTML to PDF Tutorial
View on GitHub

Ready to Get Started?

Version:2026.11just released