IRONSOFTWAREHOME
新内容印章
import {PdfDocument, HorizontalAlignment, VerticalAlignment} from "@ironsoftware/ironpdf";

(async () => {
    // Open existing PDF
    const pdf = await PdfDocument.fromFile("Sample.pdf");

    // Configure the HTML stamp
    const stampOptions = {
        horizontalAlignment: HorizontalAlignment.Center,
        verticalAlignment: VerticalAlignment.Bottom,
        behindExistingContent: false,
        opacity: 30
    };

    const html = "<img src='https://ironpdf.com/img/products/ironpdf-logo-text-dotnet.svg'/>"
    // Apply the stamp to the PDF
    await pdf.stampHtml(html, {htmlStampOptions: stampOptions});

    // Save the stamped PDF
    await pdf.saveAs("stamped_image.pdf");
})();
npm i @ironsoftware/ironpdf
新内容印章

新内容印章

HTML 盖章利用输入的 HTML 片段,通过内联 CSS 样式控制设计。 在下面的代码中,我们在 HTML 中包含了图像,然后将它们盖章到文档上。

IronPDF 提供多种多样的盖章选项,包括 HTML、文本、图像和条形码。 对于每个盖章,您可以使用垂直和水平一般位置精确定义其位置。 这些位置可以进一步使用偏移量进行调整,以实现像素级精确放置。 此外,大多数印章类型包括rotation属性。

在 GitHub 上探索 HTML 冲压示例
在 GitHub 上查看

准备开始了吗?

版本:2026.6刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥。

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

OR
bullet_checked无需信用卡或创建账户无任何限制。100% 解锁。无需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
预约您的免费现场演示
Booking Badge

深受全球数百万工程师信赖

Iron Software 的客户徽标
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥。
无需信用卡或创建账户
Node.js 模块下载用于 PDF
using npm 安装

版本: 2026.6

  1. 下载并安装 Node.js 12+。
  2. 在终端中执行上述命令。

$999 起