IRONSOFTWAREHOME
註解
from ironpdf import *

# Load an existing PDF or create a new one
pdf = PdfDocument("existing.pdf")

pageIndex = 0

# Create a TextAnnotation object
annotation = TextAnnotation(pageIndex)
annotation.Title = "This is the major title"
annotation.Subject = "This is a subtitle"
annotation.Contents = "This is the long 'sticky note' comment content..."
annotation.Icon = TextAnnotation.AnnotationIcon.Help
annotation.X = 150
annotation.Y = 200
annotation.Width = 200
annotation.Height = 50
annotation.Opacity = 0.9
annotation.Printable = False
annotation.Hidden = False
annotation.OpenByDefault = True
annotation.ReadOnly = False
annotation.Rotatable = True

# Add the annotation to a specific page and location within the PDF
pdf.Annotations.Add(annotation)

# Save the PDF
pdf.SaveAs("existing.pdf")
pip install ironpdf
註解

註解

IronPDF for Python 可以將互動式文字註釋 - 也稱為便利貼 - 新增到 PDF 文件中,允許您將評論、檢閱筆記或元資料附加到頁面上的特定位置。

入門指南

載入或建立一個Annotations集合中,然後保存。

理解程式碼

  • TextAnnotation(pageIndex):建立一個針對指定的以零為基礎頁面索引的新註釋。
  • Title:註釋彈出窗口的主要標題文字。
  • Subject:註釋的副標題或次要標題。
  • Contents:註釋的正文 - 主要的評論或筆記內容。
  • Icon:頁面上顯示的視覺圖示。 選項包括Help, Note, Comment, Key, 以及從TextAnnotation.AnnotationIcon中的其他選項。
  • X / Y:註釋錨點在頁面上的位置,以點為單位。
  • Width / Height:註釋彈出框的尺寸。
  • Opacity:控制註釋透明度的值,從 0.0 到 1.0。
  • False時,註釋不包含在列印輸出中。
  • False時,註釋在 PDF 檢視器中可見。
  • True時,當 PDF 首次檢視時,註釋彈出窗口是開啟的。
  • False時,使用者可以在 PDF 檢視器中編輯註釋。
  • True時,使用者可以旋轉註釋。
  • pdf.Annotations.Add(annotation):將已配置的註釋新增到文件中。

準備開始了嗎?

版本:2026.9剛剛發布

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天試用金鑰。
無需信用卡或帳戶建立
PDF的Python模塊下載
使用pip安裝

版本: 2026.9

  1. 下載並安裝Python 3.7+。
  2. 如果尚未安裝,請從 pypi.org 安裝 pip。
  3. 在終端執行上述命令。
Python PDF模塊
下載模塊

版本: 2026.9

手動安裝到您的專案中

  1. 下載套件
  2. 從終端運行此命令
    pip install ironpdf-2026.9-py37-none-win_amd64.whi

從$999起的授權