RichMediaAnnotation
概述
RichMediaAnnotation 是 Aspose.PDF FOSS 为 .NET 提供的一个类。继承自:Annotation。
此类提供 12 个方法,用于在 .NET 程序中处理 RichMediaAnnotation 对象。可用的方法包括:Accept、AddCustomData、ChangeAfterResize、Clone、Flatten、GetRectangle、RichMediaAnnotation、SetContent、SetPoster、Update、UpdateAppearances、WriteXfdf。所有公共成员在安装 Aspose.PDF FOSS for .NET 包后,可供任何 .NET 应用程序访问。属性:Action、Actions、ActivateOn、ActiveState、Alignment、AnnotationFlags,以及另外 46 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
AnnotationType | AnnotationType | 读取 | 获取注释类型。 |
Type | ContentType | 读写 | 媒体类型。 |
ActivateOn | ActivationEvent | 读写 | 激活触发器。 |
CustomFlashVariables | string? | 读写 | 获取或设置自定义 Flash 变量。 |
Content | System.IO.Stream? | 读取 | 主要媒体资产。 |
CustomPlayer | System.IO.Stream? | 读写 | 获取或设置自定义播放器。 |
Rect | Rectangle? | 读写 | 注释矩形(页面上的位置)。 |
InnerRect | Rectangle? | 读取 | 通过 /RD(矩形差异)条目内嵌的注释矩形——实际在 Rect 内绘制的区域。 |
Width | double | 读写 | 注释矩形的宽度。 |
Height | double | 读写 | 注释矩形的高度。 |
ActiveState | string? | 读写 | 当前活动的外观状态(/AS 条目)。 |
Alignment | TextAlignment | 读写 | 文本对齐(用于携带富文本的自由文本/小部件注释)。 |
HorizontalAlignment | Aspose.Pdf.HorizontalAlignment | 读写 | 水平对齐(在 Alignment 之外另行提供;两者可独立设置)。 |
TextHorizontalAlignment | Aspose.Pdf.HorizontalAlignment | 读写 | 文本特定的水平对齐覆盖。 |
Appearance | AppearanceDictionary | 读取 | 外观字典(/AP 条目)——以外观流名称(N、D、R)为键。 |
States | AppearanceDictionary | 读取 | 外观状态字典(AP/N 的每个状态子字典,例如). |
NormalAppearance | XForm? | 读取 | 注释的普通(/AP /N)外观,以 XForm 形式表示;如果没有则为 null。 |
UpdateAppearanceOnConvert | bool | 读写 | 是否在将注释保存到已转换的文档时重新生成外观流。 |
UseFontSubset | bool | 读写 | 是否应对嵌入的字体(如果有)进行子集化。 |
Contents | string? | 读写 | 注释内容(文本)。 |
Opacity | double | 读写 | 注释不透明度 (0.0 = 透明, 1.0 = 不透明)。 |
Border | Border? | 读写 | 注释边框。 |
Color | Color | 读写 | 注释边框颜色(/C 条目)。 |
InteriorColor | Color? | 读写 | 注释内部颜色(/IC 条目,用于圆形/方形/线条注释)。 |
Title | string? | 读写 | 注释标题(标记注释的作者)。 |
Name | string? | 读写 | 注释名称(唯一标识符——/NM 条目)。 |
FullName | string? | 读取 | 完全限定的注释名称。 |
Subject | string? | 读写 | 注释主题(/Subj 条目)。 |
ModifiedDate | string? | 读取 | 修改日期。 |
Modified | DateTime | 读写 | /M(修改)日期作为键入的 DateTime。 |
Flags | AnnotationFlags | 读写 | 注释标志(/F 条目)——用作 int 和 typed 形式的存储后端。 |
AnnotationFlags | AnnotationFlags | 读写 | Flags 的类型化别名,与公开接口匹配,公开 AnnotationFlags 为属性。 |
Action | PdfAction? | 读写 | 与此注释关联的操作(/A 条目)。 |
Actions | PdfActionCollection | 读取 | 与此注释关联的操作集合。 |
Author | string? | 读取 | 注释作者(/T 条目)。 |
AnnotationState | string? | 读取 | 注释状态(/State 条目),例如: |
AnnotationStateModel | string? | 读取 | 注释状态模型(/StateModel 条目),例如: |
ReplyType | string? | 读取 | 回复类型(/RT 条目),例如: |
InReplyTo | Annotation? | 读写 | 此回复对应的注释(/IRT 条目)。 |
QuadPoints | Point[] | 读写 | QuadPoints 作为 Point 值数组。 |
Characteristics | Characteristics | 读取 | 外观特性(边框颜色、背景颜色、旋转)。 |
PageIndex | int | 读取 | 拥有此注释的页面的基于1的索引。 |
Page | Page? | 读取 | 拥有此注释的页面,若无法解析则为 null(例如. |
VerticalAlignment | VerticalAlignment | 读写 | 已对该段落应用垂直对齐。 |
Margin | MarginInfo | 读写 | 已对该段落应用外边距信息。 |
IsFirstParagraphInColumn | bool | 读写 | 强制段落在新列开始。 |
IsKeptWithNext | bool | 读写 | 保持此段落与下一段落在同一页。 |
IsInNewPage | bool | 读写 | 强制段落在新页面开始。 |
IsInLineParagraph | bool | 读写 | 内联段落标记(不另起新行)。 |
HyperlinkText | string? | 读写 | 旧版字符串类型超链接目标。 |
Hyperlink | Hyperlink? | 读写 | 已在段落上应用类型化的超链接装饰。 |
ZIndex | int | 读写 | DOM 渲染器使用的 Z 顺序索引。 |
方法
| 签名 | 描述 |
|---|---|
RichMediaAnnotation(page: Page, rect: Rectangle) | 在此 RichMediaAnnotation 实例上调用 RichMediaAnnotation(page, rect)。 |
SetContent(fileName: string, audio: System.IO.Stream) | 设置内容值。 |
SetPoster(imageStream: System.IO.Stream) | 设置 poster 值。 |
AddCustomData(name: string, data: System.IO.Stream) | 在此 RichMediaAnnotation 实例上调用 AddCustomData(name, data)。 |
Update() | 将已存储的媒体缓冲区序列化到注释字典中:RichMediaContent(资产名称树 + 配置/实例)和 RichMediaSettings(激活),以便媒体在保存 → 重新加载后仍然存在。 |
Accept(visitor: AnnotationSelector) | 对该 RichMediaAnnotation 实例调用 Accept(visitor)。 |
GetRectangle(considerRotation: bool) | 通过 considerRotation 调整边界矩形。 |
ChangeAfterResize(transform: Matrix) | 在用户调整页面或宿主矩形大小后,调整注释的几何形状。 |
UpdateAppearances() | 根据注释当前的几何形状和颜色重新生成普通外观流 (/AP /N)。 |
WriteXfdf(writer: System.Xml.XmlWriter) | 将此注释序列化为 XFDF 元素写入(PDF 32000 §12.7.8 / XFDF 3.0)。 |
Flatten() | 将此注释扁平化 — 将其视觉外观渲染到页面内容中,并从页面的注释数组中移除。 |
Clone() | 浅拷贝 — 复制标量/引用共享的状态。 |