|
Foxit PDF SDK
|
Public 成员函数 | |
| Field (Field field) | |
| 构造函数,使用另一个表单字段对象。 更多... | |
| Field (PDFDoc document, PDFDictionary field_dict) throws com.foxit.sdk.PDFException | |
| 从字段字典构造函数。 更多... | |
| synchronized void | delete () |
| 直接清除C++相关资源。 更多... | |
| int | getAlignment () throws com.foxit.sdk.PDFException |
| 获取对齐值。 更多... | |
| String | getAlternateName () throws com.foxit.sdk.PDFException |
| 获取备用名称。 更多... | |
| Control | getControl (int index) throws com.foxit.sdk.PDFException |
| 通过索引获取表单控件。 更多... | |
| Control | getControl (PDFPage page, int index) throws com.foxit.sdk.PDFException |
| 在指定PDF页面中通过索引获取表单控件。 更多... | |
| int | getControlCount () throws com.foxit.sdk.PDFException |
| 获取表单控件数量。 更多... | |
| int | getControlCount (PDFPage page) throws com.foxit.sdk.PDFException |
| 获取指定PDF页面中的表单控件数量。 更多... | |
| DefaultAppearance | getDefaultAppearance () throws com.foxit.sdk.PDFException |
| 获取默认外观数据。 更多... | |
| String | getDefaultValue () throws com.foxit.sdk.PDFException |
| 获取默认值。 更多... | |
| PDFObject | getDefaultValueObj () throws com.foxit.sdk.PDFException |
| 获取字段默认值的PDF对象。 更多... | |
| PDFDictionary | getDict () throws com.foxit.sdk.PDFException |
| 获取当前对象的PDF字典。 更多... | |
| int | getFlags () throws com.foxit.sdk.PDFException |
| 获取字段标志。 更多... | |
| PDFObject | getInheritedAttribute (String attribute_name) throws com.foxit.sdk.PDFException |
| 获取指定属性的PDF对象,该属性可能从字段树中的祖先节点继承。 更多... | |
| String | getMappingName () throws com.foxit.sdk.PDFException |
| 获取映射名称。 更多... | |
| int | getMaxLength () throws com.foxit.sdk.PDFException |
| 获取字段文本的最大长度(以字符为单位)。 更多... | |
| String | getName () throws com.foxit.sdk.PDFException |
| 获取字段名称。 更多... | |
| ChoiceOptionArray | getOptions () throws com.foxit.sdk.PDFException |
| 获取列表框或组合框的选项。 更多... | |
| int | getTopVisibleIndex () throws com.foxit.sdk.PDFException |
| 获取可滚动列表框的选项顶部索引。 更多... | |
| int | getType () throws com.foxit.sdk.PDFException |
| 获取字段类型。 更多... | |
| String | getValue () throws com.foxit.sdk.PDFException |
| 获取值。 更多... | |
| PDFObject | getValueObj () throws com.foxit.sdk.PDFException |
| 获取字段值的PDF对象。 更多... | |
| boolean | isEmpty () |
| 检查当前对象是否为空。 更多... | |
| boolean | reset () throws com.foxit.sdk.PDFException |
| 将当前字段中的数据重置为其默认值。(不支持签名字段) 更多... | |
| void | setAlignment (int alignment) throws com.foxit.sdk.PDFException |
| 设置表单的对齐属性,作为文档范围的默认值。(不支持签名字段) 更多... | |
| void | setAlternateName (String alternate_name) throws com.foxit.sdk.PDFException |
| 设置备用名称。(不支持签名字段) 更多... | |
| void | setDefaultAppearance (DefaultAppearance default_ap) throws com.foxit.sdk.PDFException |
| 设置默认外观数据。 更多... | |
| void | setDefaultValue (String value) throws com.foxit.sdk.PDFException |
| 设置默认值。 更多... | |
| void | setFlags (int flags) throws com.foxit.sdk.PDFException |
| 设置字段标志。 更多... | |
| void | setMappingName (String name) throws com.foxit.sdk.PDFException |
| 设置映射名称。(不支持签名字段) 更多... | |
| void | setMaxLength (int max_length) throws com.foxit.sdk.PDFException |
| 设置字段文本的最大长度(以字符为单位)。 更多... | |
| void | setOptions (ChoiceOptionArray option_array) throws com.foxit.sdk.PDFException |
| 设置列表框或组合框的选项。 更多... | |
| void | setTopVisibleIndex (int index) throws com.foxit.sdk.PDFException |
| 设置可滚动列表框的顶部索引。 更多... | |
| void | setValue (String value) throws com.foxit.sdk.PDFException |
| 设置值。 更多... | |
静态 Public 属性 | |
| static final int | e_FlagButtonNoToggleToOff = 0x100 |
| (仅对单选按钮有用)如果设置,必须始终选择一个单选按钮; 点击当前选择的按钮没有效果。如果清除,点击选择的按钮会取消选择它, 不留下任何选择的按钮。 | |
| static final int | e_FlagButtonRadiosInUnison = 0x200 |
| (仅对单选按钮有用)如果设置,单选按钮字段内使用相同开启状态值的 一组单选按钮将一致地开启和关闭;也就是如果一个被选中,它们都被选中。 如果清除,按钮是互斥的。 | |
| static final int | e_FlagChoiceCommitOnSelChange = 0x400 |
| (仅对选择字段有用)如果设置,一旦用指点设备进行选择,新值就立即提交; 如果清除,新值直到用户退出字段时才提交。 | |
| static final int | e_FlagChoiceMultiSelect = 0x100 |
| (仅对列表框有用)如果设置,可以同时选择多个项目; if clear, no more than one item at a time may be selected. | |
| static final int | e_FlagChoiceSort = 0x200 |
| (仅对选择字段有用)如果设置,字段的选项项应按字母顺序排序。 | |
| static final int | e_FlagComboEdit = 0x100 |
| (仅对组合框有用)如果设置,组合框包括带有下拉列表的可编辑文本控件, 如果清除,它只包括下拉列表。 | |
| static final int | e_FlagNoExport = 0x04 |
| 如果设置,字段不能由提交表单操作导出。 | |
| static final int | e_FlagReadOnly = 0x01 |
| 如果设置,用户不能更改字段的值。任何关联的控件注释将不会 与用户交互;也就是说,它们不会响应鼠标点击或响应鼠标移动而改变外观。 此标志对于其值被计算或从数据库导入的字段很有用。 | |
| static final int | e_FlagRequired = 0x02 |
| 如果设置,字段在由提交表单操作导出时必须有一个值。 | |
| static final int | e_FlagTextComb = 0x2000 |
| (仅对文本字段有用)如果设置,使用梳状格式。 更多... | |
| static final int | e_FlagTextDoNotScroll = 0x1000 |
| (仅对文本字段有用)如果设置,字段不滚动(单行字段水平滚动, 多行字段垂直滚动)以容纳超出其注释矩形的更多文本。 一旦字段满了,就不再接受更多文本。 | |
| static final int | e_FlagTextFileSelect = 0x400 |
| (仅对文本字段有用)如果设置,在字段中输入的文本表示文件的路径名, 其内容将作为字段的值提交。 | |
| static final int | e_FlagTextMultiline = 0x100 |
| (仅对文本字段有用)如果设置,文本字段可以包含多行文本; 如果清除,字段的文本限制为单行。 | |
| static final int | e_FlagTextNoSpellCheck = 0x800 |
| (仅对文本字段有用)如果设置,在字段中输入的文本不进行拼写检查。 | |
| static final int | e_FlagTextPassword = 0x200 |
| (仅对文本字段有用)如果设置,字段用于输入不应在屏幕上可见回显的安全密码。 从键盘输入的字符应该以某种不可读的形式回显,例如星号或项目符号字符。 更多... | |
| static final int | e_FlagTextRichText = 0x4000 |
| (仅对文本字段有用)如果设置,此字段的值应表示为富文本字符串。 | |
| static final int | e_TypeCheckBox = 2 |
| 表单字段类型:复选框。 | |
| static final int | e_TypeComboBox = 4 |
| 表单字段类型:组合框。 | |
| static final int | e_TypeListBox = 5 |
| 表单字段类型:列表框。 | |
| static final int | e_TypePushButton = 1 |
| 表单字段类型:按钮。 | |
| static final int | e_TypeRadioButton = 3 |
| 表单字段类型:单选按钮。 | |
| static final int | e_TypeSignature = 7 |
| 表单字段类型:签名字段。 | |
| static final int | e_TypeTextField = 6 |
| 表单字段类型:文本字段。 | |
| static final int | e_TypeUnknown = 0 |
| 表单字段类型:未知。 | |
在PDF文档中,表单字段出现在页面的任何组合上,所有这些字段组成一个跨越整个文档的 单一全局交互式表单。函数Form.getField 可用于从交互式表单获取表单字段。 此类提供了获取表单字段一些信息/属性、将表单字段重置为其默认值以及从表单字段获取 表单控件的函数。
当表单字段的类型为com.foxit.sdk.pdf.interform.Field.e_TypeSignature 时, 表单字段对象实际上是一个签名对象。
要访问附加操作,请使用Field对象构造com.foxit.sdk.pdf.actions.AdditionalAction 对象。
| com.foxit.sdk.pdf.interform.Field.Field | ( | PDFDoc | document, |
| PDFDictionary | field_dict | ||
| ) | throws com.foxit.sdk.PDFException |
从字段字典构造函数。
| [in] | document | 一个有效的PDF文档。 |
| [in] | field_dict | 表示表单字段的PDF字典。它应该属于参数document指定的PDF文档。 |
| com.foxit.sdk.pdf.interform.Field.Field | ( | Field | field | ) |
构造函数,使用另一个表单字段对象。
| [in] | field | 另一个表单字段对象。 |
| synchronized void com.foxit.sdk.pdf.interform.Field.delete | ( | ) |
直接清除C++相关资源。
重载 com.foxit.sdk.common.Base .
被 com.foxit.sdk.pdf.Signature , 以及 com.foxit.sdk.pdf.PagingSealSignature 重载.
| int com.foxit.sdk.pdf.interform.Field.getAlignment | ( | ) | throws com.foxit.sdk.PDFException |
获取对齐值。
对齐是可变文本的属性,仅对文本字段、列表框和组合框有用, 这些字段可能包含可变文本作为其内容。
如果文本字段或列表框有自己的对齐值,则将忽略文档范围的默认对齐值; 否则,将为文本字段或列表框使用文档范围的默认对齐值。
| String com.foxit.sdk.pdf.interform.Field.getAlternateName | ( | ) | throws com.foxit.sdk.PDFException |
获取备用名称。
备用字段名称用于在用户界面中必须标识字段的任何地方 (例如在引用字段的错误或状态消息中)代替实际字段名称。 此文本在提取文档内容以支持残障用户的可访问性或其他目的时也很有用。
| Control com.foxit.sdk.pdf.interform.Field.getControl | ( | int | index | ) | throws com.foxit.sdk.PDFException |
| Control com.foxit.sdk.pdf.interform.Field.getControl | ( | PDFPage | page, |
| int | index | ||
| ) | throws com.foxit.sdk.PDFException |
在指定PDF页面中通过索引获取表单控件。
| [in] | page | 有效的PDF页面对象。它应该与当前表单字段在同一文档中。 |
| [in] | index | 表单控件索引。有效范围:从0到(count-1)。 count由函数Field.getControlCount 使用 相同参数page返回。 |
| int com.foxit.sdk.pdf.interform.Field.getControlCount | ( | ) | throws com.foxit.sdk.PDFException |
获取表单控件数量。
| int com.foxit.sdk.pdf.interform.Field.getControlCount | ( | PDFPage | page | ) | throws com.foxit.sdk.PDFException |
获取指定PDF页面中的表单控件数量。
| [in] | page | 有效的PDF页面对象。它应该与当前表单字段在同一文档中。 |
| DefaultAppearance com.foxit.sdk.pdf.interform.Field.getDefaultAppearance | ( | ) | throws com.foxit.sdk.PDFException |
获取默认外观数据。
| String com.foxit.sdk.pdf.interform.Field.getDefaultValue | ( | ) | throws com.foxit.sdk.PDFException |
获取默认值。
适用于除按钮以外的所有字段。
| PDFObject com.foxit.sdk.pdf.interform.Field.getDefaultValueObj | ( | ) | throws com.foxit.sdk.PDFException |
获取字段默认值的PDF对象。
字段默认值的格式因字段类型而异。有关更多详细信息, 请参考《PDF参考1.7》P676中的"表8.69 所有字段字典的通用条目"。
| PDFDictionary com.foxit.sdk.pdf.interform.Field.getDict | ( | ) | throws com.foxit.sdk.PDFException |
获取当前对象的PDF字典。
| int com.foxit.sdk.pdf.interform.Field.getFlags | ( | ) | throws com.foxit.sdk.PDFException |
获取字段标志。
字段标志指定表单字段的各种特征。
| PDFObject com.foxit.sdk.pdf.interform.Field.getInheritedAttribute | ( | String | attribute_name | ) | throws com.foxit.sdk.PDFException |
获取指定属性的PDF对象,该属性可能从字段树中的祖先节点继承。
某些字段属性被指定为可继承的,例如"Ff"、"V"、"DV"等。 请参考《PDF参考1.7》P675中的"表8.69 所有字段字典的通用条目"。 如果没有由attribute_name指定的条目或发生任何错误,此函数将返回null。
| [in] | attribute_name | 要查找的属性名称。 |
| String com.foxit.sdk.pdf.interform.Field.getMappingName | ( | ) | throws com.foxit.sdk.PDFException |
获取映射名称。
映射名称用于从文档导出交互式表单字段数据时使用。
| int com.foxit.sdk.pdf.interform.Field.getMaxLength | ( | ) | throws com.foxit.sdk.PDFException |
获取字段文本的最大长度(以字符为单位)。
适用于文本字段。对于不适用的字段类型,此函数将返回0。
| String com.foxit.sdk.pdf.interform.Field.getName | ( | ) | throws com.foxit.sdk.PDFException |
获取字段名称。
| ChoiceOptionArray com.foxit.sdk.pdf.interform.Field.getOptions | ( | ) | throws com.foxit.sdk.PDFException |
获取列表框或组合框的选项。
适用于列表框和组合框。对于不适用的字段类型, 此函数将返回空数组。
| int com.foxit.sdk.pdf.interform.Field.getTopVisibleIndex | ( | ) | throws com.foxit.sdk.PDFException |
获取可滚动列表框的选项顶部索引。
适用于列表框。对于不适用的字段类型, 此函数将返回0。
选项的顶部索引是列表中第一个可见选项的索引。
| int com.foxit.sdk.pdf.interform.Field.getType | ( | ) | throws com.foxit.sdk.PDFException |
获取字段类型。
| String com.foxit.sdk.pdf.interform.Field.getValue | ( | ) | throws com.foxit.sdk.PDFException |
获取值。
适用于除按钮以外的所有字段。 对于不适用的字段类型,将返回空字符串。 对于复选框和单选框,此函数将返回外观状态值。
| PDFObject com.foxit.sdk.pdf.interform.Field.getValueObj | ( | ) | throws com.foxit.sdk.PDFException |
获取字段值的PDF对象。
字段值的格式因字段类型而异。有关更多详细信息,请参考 《PDF参考1.7》P676中的"表8.69 所有字段字典的通用条目"。
| boolean com.foxit.sdk.pdf.interform.Field.isEmpty | ( | ) |
| boolean com.foxit.sdk.pdf.interform.Field.reset | ( | ) | throws com.foxit.sdk.PDFException |
将当前字段中的数据重置为其默认值。(不支持签名字段)
| void com.foxit.sdk.pdf.interform.Field.setAlignment | ( | int | alignment | ) | throws com.foxit.sdk.PDFException |
设置表单的对齐属性,作为文档范围的默认值。(不支持签名字段)
对齐是可变文本的属性,仅对文本字段、列表框和组合框有用, 这些字段可能包含可变文本作为其内容。
如果文本字段或列表框有自己的对齐值,则将忽略文档范围的默认对齐值; 否则,将为文本字段或列表框使用文档范围的默认对齐值。
如果当前表单字段是签名字段,此函数不执行任何操作。
| [in] | alignment | 可变文本的新默认对齐类型。请参考从 com.foxit.sdk.common.Constants.e_AlignmentLeft 开始的值,这应该是其中一个值。 如果使用其他值设置,默认将使用com.foxit.sdk.common.Constants.e_AlignmentLeft 。 |
| void com.foxit.sdk.pdf.interform.Field.setAlternateName | ( | String | alternate_name | ) | throws com.foxit.sdk.PDFException |
设置备用名称。(不支持签名字段)
备用字段名称用于在用户界面中必须标识字段的任何地方 (例如在引用字段的错误或状态消息中)代替实际字段名称。 此文本在提取文档内容以支持残障用户的可访问性或其他目的时也很有用。
如果当前表单字段是签名字段,此函数不执行任何操作。
| [in] | alternate_name | 新的备用名称字符串。它不应该是空字符串。 |
| void com.foxit.sdk.pdf.interform.Field.setDefaultAppearance | ( | DefaultAppearance | default_ap | ) | throws com.foxit.sdk.PDFException |
设置默认外观数据。
| [in] | default_ap | 新的默认外观。输入数据的flags可用于决定 哪些信息要用新数据更新;对于那些没有更新的数据, 它们将继续使用旧数据。 如果输入默认外观数据的text_size为0,意味着文本大小 应该自动计算。 |
| void com.foxit.sdk.pdf.interform.Field.setDefaultValue | ( | String | value | ) | throws com.foxit.sdk.PDFException |
设置默认值。
适用于除按钮以外的所有字段。 对于不适用的字段类型,此函数不执行任何操作。
| [in] | value | 新的默认值字符串。它不应该是空字符串。 |
| void com.foxit.sdk.pdf.interform.Field.setFlags | ( | int | flags | ) | throws com.foxit.sdk.PDFException |
设置字段标志。
字段标志指定表单字段的各种特征。
| [in] | flags | 新的表单字段标志。请参考从com.foxit.sdk.pdf.interform.Field.e_FlagReadOnly 开始的值, 这应该是其中一个值或这些值的组合。 |
| void com.foxit.sdk.pdf.interform.Field.setMappingName | ( | String | name | ) | throws com.foxit.sdk.PDFException |
设置映射名称。(不支持签名字段)
映射名称用于从文档导出交互式表单字段数据时使用。 如果当前表单字段是签名字段,此函数不执行任何操作。
| [in] | name | 新的映射名称字符串。它不应该是空字符串。 |
| void com.foxit.sdk.pdf.interform.Field.setMaxLength | ( | int | max_length | ) | throws com.foxit.sdk.PDFException |
设置字段文本的最大长度(以字符为单位)。
适用于文本字段。对于不适用的字段类型,此函数不执行任何操作。
| [in] | max_length | 字段文本的新最大长度。它应该是非负数。 |
| void com.foxit.sdk.pdf.interform.Field.setOptions | ( | ChoiceOptionArray | option_array | ) | throws com.foxit.sdk.PDFException |
设置列表框或组合框的选项。
适用于列表框和组合框。对于不适用的字段类型, 此函数不执行任何操作。
| [in] | option_array | 要设置到列表框或组合框的选项数组。 |
| void com.foxit.sdk.pdf.interform.Field.setTopVisibleIndex | ( | int | index | ) | throws com.foxit.sdk.PDFException |
设置可滚动列表框的顶部索引。
适用于列表框。对于不适用的字段类型, 此函数不执行任何操作。
选项的顶部索引是列表中第一个可见选项的索引。
| [in] | index | 列表中第一个可见选项的索引。 |
| void com.foxit.sdk.pdf.interform.Field.setValue | ( | String | value | ) | throws com.foxit.sdk.PDFException |
设置值。
适用于除按钮以外的所有字段。对于不适用的字段类型, 此函数不执行任何操作。
特别地,对于组合框和文本字段,当成功设置值时,此函数还将 触发相关的计算和格式化事件并更新字段的外观。
| [in] | value | 新值字符串。特别地,当当前字段是列表框字段时,此参数可以 包含多个值: 当要设置多个值时,每个值应该用"()"包装。例如, "(ABC)(CCC)" 表示设置两个值 "ABC" 和 "CCC"。 如果值包含"()"或"\\"作为其内容,请在每个"()"或"\\"字符前 添加额外的"\\"作为转义字符。例如:
|
|
static |
(仅对文本字段有用)如果设置,使用梳状格式。
如果设置,字段自动分为与字段文本最大长度值相等的等间距位置或梳状格, 文本被布局到这些梳状格中。
|
static |
(仅对文本字段有用)如果设置,字段用于输入不应在屏幕上可见回显的安全密码。 从键盘输入的字符应该以某种不可读的形式回显,例如星号或项目符号字符。