RichTextBoxField
概述
RichTextBoxField 是 Aspose.PDF FOSS 中用于 .NET 的类。继承自:TextBoxField。
一个 Tx 表单字段,携带富文本标志(/Ff 的第 26 位)。
此类提供 34 个方法,用于在 .NET 程序中处理 RichTextBoxField 对象。可用的方法包括:Accept、AddBarcode、AddImage、ChangeAfterResize、Clone、CopyTo、ExecuteFieldJavaScript、ExportToJson、ExportValueToJson、Field、Flatten、GetCheckedStateName,以及另外 11 个方法。安装 Aspose.PDF FOSS for .NET 包后,所有公共成员对任何 .NET 应用程序均可访问。属性:Action、Actions、ActiveState、Alignment、AlternateName、AnnotationFlags,以及另外 86 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
RichTextValue | string? | 读写 | 字段值的富文本表示(PDF /RV 条目)。 |
FormattedValue | string? | 读写 | 已格式化(富文本)表示;是 RichTextValue 的别名。 |
Value | string? | 读写 | 此字段渲染的纯文本值(/V 条目)。 |
Style | string | 读写 | CSS-style 样式字符串应用于富文本片段 — 例如: |
Justify | Aspose.Pdf.Annotations.Justification | 读写 | 文本对齐。 |
MaxFontSize | double | 读写 | 对所有新创建的TextBoxFields的自动适配外观应用静态默认值。 |
MinFontSize | double | 读写 | 对所有新创建的TextBoxFields的自动适配外观应用静态默认值——自动调整大小字体的下限。 |
FitIntoRectangle | bool | 读写 | 对所有新创建的TextBoxFields的FitIntoRectangle标志应用静态默认值。 |
Width | double | 读写 | 当字段放置在布局容器(表格单元格、段落)中时的布局宽度。 |
Height | double | 读写 | 当字段放置在布局容器中时的布局高度。 |
Multiline | bool | 读写 | 多行标志(/Ff 的第13位)。 |
MaxLen | int | 读写 | 获取或设置最大长度。 |
IsMultiline | bool | 读取 | 获取是否为多行。 |
IsPassword | bool | 读取 | 获取是否为密码。 |
TextVerticalAlignment | VerticalAlignment | 读写 | 字段外观内部文本的垂直对齐方式。 |
IsRichText | bool | 读取 | 当 Tx 字段设置了富文本标志(/Ff 的第 26 位)时为 True。 |
Justification | int | 读取 | 文本对齐方式:0 = 左,1 = 居中,2 = 右。 |
ForceCombs | bool | 读写 | 位 25 的 /Ff(Comb):当置位时,字段被划分为 MaxLen 等宽的梳子。 |
Scrollable | bool | 读写 | 位 24 的 /Ff(DoNotScroll)的反相。 |
SpellCheck | bool | 读写 | 位 23 的 /Ff(DoNotSpellCheck)的反相。 |
Type | FieldType | 读取 | 字段类型。 |
FullName | string? | 读取 | 完全限定的字段名称。 |
TextHorizontalAlignment | Aspose.Pdf.HorizontalAlignment | 读写 | 针对文本的水平对齐覆盖,应用于字段小部件的外观。 |
PageIndex | int | 读取 | 拥有此字段小部件的页面的 1 基索引。 |
PartialName | string? | 读写 | 部分字段名称 (/T)。 |
NormalAppearance | XForm? | 读取 | 字段的“Normal”外观(/AP /N 条目)。 |
Appearance | Aspose.Pdf.Annotations.AppearanceDictionary | 读取 | 字段小部件的外观流(/AP 条目),以外观名称为键。 |
OnActivated | Annotations.PdfAction? | 读写 | 当此字段被激活时触发的操作(/A 条目)。 |
Count | int | 读取 | 此字段的 /Kids 数组中的子项数量——可以是子字段(层级节点)或小部件注释(具有多个可视小部件的终端字段,例如分组的复选框/单选按钮)。 |
Fields | Field[] | 读取 | 此字段的字段类型子项,以快照数组形式呈现——便利访问器,映射表单上的 Fields。 |
DefaultValue | string? | 读取 | 默认值 (/DV)。 |
AlternateName | string? | 读写 | 备用字段名称 / 工具提示 (/TU 条目)。 |
Flags | Aspose.Pdf.Annotations.AnnotationFlags | 读写 | 小部件注释标志 (/F 条目),例如。 |
TabOrder | int | 读写 | 此字段的 Tab 顺序索引。 |
IsReadOnly | bool | 读取 | 该字段是否为只读。 |
ReadOnly | bool | 读写 | 该字段是否为只读(可设置的 API 奇偶校验别名)。 |
IsRequired | bool | 读取 | 该字段是否为必填。 |
Characteristics | Aspose.Pdf.Annotations.Characteristics | 读取 | 外观特征(边框/背景颜色,小部件旋转)。 |
DefaultAppearance | Aspose.Pdf.Annotations.DefaultAppearance | 读写 | 字段的默认外观(字体、大小、颜色)——字段级别对应的 WidgetAnnotation。 |
Rect | Rectangle? | 读写 | 字段矩形。 |
Color | Color | 读写 | 字段颜色(存储在 /DA 默认外观字符串中,采用 RGB)。 |
AnnotationIndex | int | 读写 | 该字段小部件在其页面的 /Annots 数组中的基于 1 的标签位置 — 数组顺序即页面标签顺序。 |
IsGroup | bool | 读取 | 此字段是否为子字段的容器/组。 |
IsSharedField | bool | 读写 | 此字段是否属于 shared-fields 组。 |
IsSynchronized | bool | 读取 | 集合是否是线程安全的。 |
SyncRoot | object | 读取 | 同步根;返回此实例。 |
MappingName | string? | 读写 | 映射名称,供外部脚本用于标识该字段。 |
AnnotationType | AnnotationType | 读取 | 始终 Widget。 |
Border | Border? | 读写 | 边框宽度、样式和虚线模式从 widget 的 BS 字典中解析(表单字段在该字典中携带其边框,而不是在 /Border 中)。 |
Actions | AnnotationActionCollection | 读取 | widget 的 /AA 树的操作槽。 |
Exportable | bool | 读写 | 是否应在表单提交时导出小部件的值。 |
Highlighting | HighlightingMode | 读写 | 当用户点击 widget(/H 条目)时使用的可视高亮模式。 |
Parent | Forms.Field? | 读取 | 当此 widget 是 AcroForm 字段的可视子字段时的父字段。 |
Required | bool | 读写 | 小部件在提交之前是否必须填写(/Ff 位 2)。 |
HighlightMode | string | 读取 | 高亮模式(/H 条目)。 |
DefaultAppearanceString | string? | 读取 | 默认外观字符串(/DA 条目)。 |
FieldValue | string? | 读取 | 字段值(/V entry)。 |
DefaultFieldValue | string? | 读取 | 默认字段值(/DV entry)。 |
FieldType | string? | 读取 | 字段类型(/FT entry)。 |
InnerRect | Rectangle? | 读取 | 注释矩形通过 /RD(rectangle differences)条目向内缩进——实际在 Rect 内绘制的区域。 |
ActiveState | string? | 读写 | 当前激活的外观状态(/AS 条目)。 |
Alignment | TextAlignment | 读写 | 文本对齐(用于包含富文本的自由文本/小部件注释)。 |
HorizontalAlignment | Aspose.Pdf.HorizontalAlignment | 读写 | 水平对齐(在 Alignment 之外额外暴露;两者可以独立设置)。 |
States | AppearanceDictionary | 读取 | 外观状态字典(AP/N 的每个状态子字典,例如. |
UpdateAppearanceOnConvert | bool | 读写 | 是否在将注释保存到已转换的文档时重新生成外观流。 |
UseFontSubset | bool | 读写 | 是否应对嵌入的字体(如果有)进行子集化。 |
Contents | string? | 读写 | 注释内容(文本)。 |
Opacity | double | 读写 | 批注不透明度 (0.0 = 透明, 1.0 = 不透明)。 |
InteriorColor | Color? | 读写 | 批注内部颜色(/IC 条目,用于圆形/方形/线条批注)。 |
Title | string? | 读写 | 批注标题(标记批注的作者)。 |
Name | string? | 读写 | 注释名称(唯一标识符——/NM 条目)。 |
Subject | string? | 读写 | 注释主题(/Subj 条目)。 |
ModifiedDate | string? | 读取 | 修改日期。 |
Modified | DateTime | 读写 | 作为已键入的 DateTime 的 /M(修改)日期。 |
AnnotationFlags | AnnotationFlags | 读写 | 匹配公开表面的 Flags 的已键入别名,将 AnnotationFlags 公开为属性。 |
Action | PdfAction? | 读写 | 与此注释关联的操作(/A 条目)。 |
Author | string? | 读取 | 注释的作者(/T 条目)。 |
AnnotationState | string? | 读取 | 注释的状态(/State 条目),例如。 |
AnnotationStateModel | string? | 读取 | 注释状态模型(/StateModel 条目),例如。 |
ReplyType | string? | 读取 | 回复类型(/RT 条目),例如。 |
InReplyTo | Annotation? | 读写 | 此回复所对应的注释(/IRT 条目)。 |
QuadPoints | Point[] | 读写 | QuadPoints 作为 Point 值的数组。 |
Page | Page? | 读取 | 拥有此注释的页面,如果无法解析则为 null(例如. |
VerticalAlignment | VerticalAlignment | 读写 | 已对该段落应用垂直对齐。 |
Margin | MarginInfo | 读写 | 外边距信息已应用于此段落。 |
IsFirstParagraphInColumn | bool | 读写 | 强制该段落在新列开始。 |
IsKeptWithNext | bool | 读写 | 保持此段落与下一段落在同一页。 |
IsInNewPage | bool | 读写 | 强制段落在新页面上开始。 |
IsInLineParagraph | bool | 读写 | 内联段落标志(不另起新行)。 |
HyperlinkText | string? | 读写 | 遗留的字符串类型超链接目标。 |
Hyperlink | Hyperlink? | 读写 | 已在段落上应用的已类型化超链接装饰。 |
ZIndex | int | 读写 | DOM 渲染器使用的 Z-order 索引。 |
方法
| 签名 | 描述 |
|---|---|
RichTextBoxField(page: Page, rect: Rectangle) | 在给定的页面矩形上构建富文本字段。 |
TextBoxField(page: Page, rect: Rectangle) | 在指定页面上使用给定的矩形创建新的文本框字段。 |
TextBoxField(doc: Document, rect: Rectangle) | 创建一个与文档关联的新文本框字段(页面通过 Form.Add 分配)。 |
TextBoxField(doc: Document) | 与文档绑定的文本框(无矩形)。 |
TextBoxField(page: Page, rects: Rectangle[]) | Multi-widget 文本字段 — 第一个矩形用于 widget 字典;其余矩形根据 multi-widget 合约存储在 /Kids 上。 |
TextBoxField() | 无参数 ctor — 创建一个未绑定的文本框字段。 |
AddBarcode(code: string) | 在字段值中将代码编码为占位条形码。 |
AddImage(image: System.Drawing.Image) | 图像叠加支持的 Stub。 |
Field(doc: Document) | 创建一个与文档绑定的字段。 |
GetEnumerator() | 遍历此字段在 /Kids 数组中的子项的 widget 注释。 |
CopyTo(array: Aspose.Pdf.Annotations.WidgetAnnotation[], index: int) | 将 widget 注释复制到数组中,从指定索引开始。 |
CopyTo(array: Field[], index: int) | 将此字段的子项(作为 Field 实例)复制到数组中,从指定索引开始。 |
ExecuteFieldJavaScript(javaScriptAction: Aspose.Pdf.Annotations.JavascriptAction) | 对该字段执行提供的 JavaScript 操作。 |
ExportToJson(stream: Stream) | 将此字段序列化为 JSON(单个 FieldExportingData 对象),通过提供的流。 |
ExportToJson(fileName: string) | 将此字段序列化为 JSON 文件。 |
ExportToJson(stream: Stream, options: ExportFieldsToJsonOptions?) | 将此字段序列化为 JSON,通过提供的流。 |
ExportToJson(fileName: string, options: ExportFieldsToJsonOptions?) | 将此字段序列化为 JSON 文件。 |
ExportValueToJson(outputJsonStream: Stream, indented: bool) | 将字段的名称、标志和数值写入 JSON 流。 |
Flatten() | 将此字段展平——将其值转换为静态页面内容。 |
GetWidgetEnumerator() | 枚举器的类型为 WidgetAnnotation。 |
ImportValueFromJson(inputJsonStream: Stream) | 从 JSON 流读取此字段的值。 |
ImportValueFromJson(inputJsonStream: Stream, fieldFullNameInJSON: string) | 从 JSON 流中读取具名字段的值——单个字段对象(可能通过 ChildFields 嵌套)或它们的数组——并应用其点路径匹配 fieldFullNameInJSON 的条目的值。 |
Recalculate() | 根据其计算脚本重新计算字段的值。 |
SetPosition(point: Aspose.Pdf.Point) | 将字段的第一个小部件矩形移动到提供的点(左上角)。 |
WidgetAnnotation(doc: Document) | 编程构造函数 — 创建一个与 doc’s reader 关联的裸小部件注释。 |
ExportToJson(stream: System.IO.Stream) | 将此小部件的字段序列化为 JSON 并写入流。 |
ExportToJson(stream: System.IO.Stream, options: ExportFieldsToJsonOptions?) | 将此小部件的字段序列化为单个 FieldExportingData JSON 对象,并写入流。 |
GetCheckedStateName() | 返回表示此小部件“打开”/“已选中”状态的外观状态名称(通常为 “Yes”),该名称从 /AP/N 字典的键中查找(即除 “Off” 之外的所有键)。 |
Accept(visitor: AnnotationSelector) | 在此 RichTextBoxField 实例上调用 Accept(visitor)。 |
GetRectangle(considerRotation: bool) | 边界矩形已通过 considerRotation 进行调整。 |
ChangeAfterResize(transform: Matrix) | 在用户调整页面或宿主矩形大小后,调整注释的几何形状。 |
UpdateAppearances() | 根据注释当前的几何形状和颜色重新生成普通外观流 (/AP /N)。 |
WriteXfdf(writer: System.Xml.XmlWriter) | 将此注释序列化为 XFDF 元素写入 writer(PDF 32000 §12.7.8 / XFDF 3.0)。 |
Clone() | 浅克隆 — 复制标量/引用共享状态。 |