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
使用npm安裝

版本: 2026.6

  1. 下載並安裝Node.js 12+。
  2. 在終端機中執行上述命令。

授權從$999起