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:在页面上显示的视觉图标。 选项包括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 天试用密钥。
无需信用卡或创建账户
Python 模块下载 PDF
using 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 起