HTML文件到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文件到PDF

HTML文件到PDF

在 GitHub 上查看

准备开始了吗?

版本:2026.11刚刚发布