Foxit PDF SDK
com.foxit.sdk.pdf.PDFPage类 参考
类 com.foxit.sdk.pdf.PDFPage 继承关系图:
com.foxit.sdk.pdf.GraphicsObjects com.foxit.sdk.common.Base

Public 成员函数

 PDFPage (GraphicsObjects other)
 构造函数,使用父类对象。
更多...
 
 PDFPage (PDFDoc document, PDFDictionary page_dict)
 构造函数,从表示PDF页面的PDF字典和包含该字典的PDF文档创建。
更多...
 
Annot addAnnot (int type, RectF rect) throws com.foxit.sdk.PDFException
 向当前PDF页面添加注释。
更多...
 
Annot addAnnot (PDFDictionary annot_dict) throws com.foxit.sdk.PDFException
 向当前PDF页面添加注释(通过有效的注释字典)。
更多...
 
boolean addImage (Image image, int frame_index, PointF position, float width, float height, boolean auto_generate_content) throws com.foxit.sdk.PDFException
 添加图像到当前页面。
更多...
 
boolean addImageFromFilePath (String file_path, PointF position, float width, float height, boolean auto_generate_content) throws com.foxit.sdk.PDFException
 从文件路径添加图像到当前页面。
更多...
 
Signature addSignature (RectF rect) throws com.foxit.sdk.PDFException
 向PDF页面添加普通签名。
更多...
 
Signature addSignature (RectF rect, String field_name) throws com.foxit.sdk.PDFException
 向PDF页面添加普通签名。
更多...
 
Signature addSignature (RectF rect, String field_name, int signature_type, boolean to_check_permission) throws com.foxit.sdk.PDFException
 向PDF页面添加签名。
更多...
 
Signature addSignatureWithExistedVDict (RectF rect, String field_name, int signature_type, boolean to_check_permission, Signature existed_signature) throws com.foxit.sdk.PDFException
 使用特定签名中已存在的"V"字典添加签名到 PDF 页面。
更多...
 
RectF addText (String text, RectF rect, RichTextStyle style, int rotation, int rotate_point, boolean disable_embed_font) throws com.foxit.sdk.PDFException
 添加文本到当前页面。
更多...
 
boolean addText (String text, RectF rect, RichTextStyle style, Matrix2D matrix, boolean is_each_text, boolean disable_embed_font) throws com.foxit.sdk.PDFException
 添加文本到当前页面。
更多...
 
RectF calcContentBBox (int mode) throws com.foxit.sdk.PDFException
 计算PDF页面的内容区域。
更多...
 
RectF calculateNewRectForText (String text, RectF rect, RichTextStyle style, int rotation, int rotate_point, boolean disable_embed_font) throws com.foxit.sdk.PDFException
 计算新文本矩形。
更多...
 
void clearRenderCache ()
 清除渲染缓存。
更多...
 
synchronized void delete ()
 直接清除C++相关资源。 更多...
 
boolean flatten (boolean for_display, int options) throws com.foxit.sdk.PDFException
 拼合当前PDF页面:根据指定选项,注释或表单字段可能成为页面内容的一部分。
更多...
 
boolean flattenAnnot (Annot annot) throws com.foxit.sdk.PDFException
 拼合注释:将注释合并到页面内容中,然后将其移除。
更多...
 
Annot getAnnot (int index) throws com.foxit.sdk.PDFException
 通过索引获取注释。
更多...
 
Annot getAnnotAtDevicePoint (PointF position, float tolerance, Matrix2D matrix) throws com.foxit.sdk.PDFException
 获取指定位置的注释,在设备坐标系统中。
更多...
 
Annot getAnnotAtPoint (PointF position, float tolerance) throws com.foxit.sdk.PDFException
 获取指定位置的注释,在中。
更多...
 
int getAnnotCount () throws com.foxit.sdk.PDFException
 获取注释的数量。
更多...
 
PDFArray getAnnots () throws com.foxit.sdk.PDFException
 获取"Annots"的 PDF 数组。
更多...
 
AnnotArray getAnnotsAtDevicePoint (PointF position, float tolerance, Matrix2D matrix) throws com.foxit.sdk.PDFException
 获取指定位置的所有注释,在设备坐标系统中。
更多...
 
AnnotArray getAnnotsAtPoint (PointF position, float tolerance) throws com.foxit.sdk.PDFException
 获取指定位置的所有注释,在中。
更多...
 
RectF getBox (int box_type) throws com.foxit.sdk.PDFException
 获取页面框。
更多...
 
PDFObject getContents () throws com.foxit.sdk.PDFException
 获取"Contents"的 PDF 对象。
更多...
 
PDFDictionary getDict () throws com.foxit.sdk.PDFException
 获取页面字典。
更多...
 
Matrix2D getDisplayMatrix (int left, int top, int width, int height, int rotate) throws com.foxit.sdk.PDFException
 获取PDF页面的显示矩阵,从到 目标设备坐标系统。
更多...
 
PDFDoc getDocument () throws com.foxit.sdk.PDFException
 获取当前PDF页面所属的PDF文档。
更多...
 
GraphicsObject getGraphicsObjectAtDevicePoint (PointF point, float tolerance, Matrix2D matrix, int filter) throws com.foxit.sdk.PDFException
 获取设备坐标系统中指定点的最顶层图形对象,使用指定的类型过滤器。
更多...
 
GraphicsObject getGraphicsObjectAtPoint (PointF point, float tolerance, int filter) throws com.foxit.sdk.PDFException
 获取指定点的最顶层图形对象,使用指定的类型过滤器。
更多...
 
GraphicsObject getGraphicsObjectAtRectangle (RectF rect, int filter) throws com.foxit.sdk.PDFException
 获取矩形与指定矩形相交的最顶层图形对象,使用指定的类型过滤器。
更多...
 
GraphicsObjectArray getGraphicsObjectsAtDevicePoint (PointF point, float tolerance, Matrix2D matrix, int filter) throws com.foxit.sdk.PDFException
 获取设备坐标系统中指定点的所有图形对象,使用指定的类型过滤器。
更多...
 
GraphicsObjectArray getGraphicsObjectsAtPoint (PointF point, float tolerance, int filter) throws com.foxit.sdk.PDFException
 获取指定点的所有图形对象,使用指定的类型过滤器。
更多...
 
GraphicsObjectArray getGraphicsObjectsAtRectangle (RectF rect, int filter) throws com.foxit.sdk.PDFException
 获取矩形与指定矩形相交的所有图形对象,使用指定的类型过滤器。
更多...
 
float getHeight () throws com.foxit.sdk.PDFException
 获取页面高度(单位是1/72英寸)。
更多...
 
int getIndex () throws com.foxit.sdk.PDFException
 获取页面索引。
更多...
 
PDFObject getInheritedAttribute (String attruibute_name) throws com.foxit.sdk.PDFException
 获取指定属性的 PDF 对象,该属性可能从页面树中的祖先节点继承。
更多...
 
PDFDictionary getResources () throws com.foxit.sdk.PDFException
 获取"Resources"的 PDF 字典。
更多...
 
int getRotation () throws com.foxit.sdk.PDFException
 获取页面旋转。
更多...
 
RectF getSuggestedRect (Bitmap render_result, Matrix2D render_matrix, PointF point) throws com.foxit.sdk.PDFException
 基于渲染结果位图为点(位于 )获取建议的矩形(位于 )。
更多...
 
PDFStream getThumb () throws com.foxit.sdk.PDFException
 获取"Thumb"的 PDF 流。
更多...
 
float getUserUnitSize () throws com.foxit.sdk.PDFException
 获取用户单位。
更多...
 
float getWidth () throws com.foxit.sdk.PDFException
 获取页面宽度(单位是1/72英寸)。
更多...
 
boolean hasTransparency () throws com.foxit.sdk.PDFException
 检查当前PDF页面是否具有透明度。
更多...
 
boolean hasWatermark () throws com.foxit.sdk.PDFException
 检查当前页面是否有水印(不包括Foxit PDF SDK试用水印)。
更多...
 
boolean isParsed () throws com.foxit.sdk.PDFException
 检查当前页面是否已被解析。
更多...
 
boolean isScanned () throws com.foxit.sdk.PDFException
 检查当前PDF页面是否为扫描页面。
更多...
 
Bitmap loadThumbnail () throws com.foxit.sdk.PDFException
 加载缩略图位图。
更多...
 
void moveAnnotToFirst (Annot annot) throws com.foxit.sdk.PDFException
 将指定注释更改为所有注释中的第一个。
更多...
 
void moveAnnotToLast (Annot annot) throws com.foxit.sdk.PDFException
 将指定注释更改为所有注释中的最后一个。
更多...
 
void moveAnnotToNext (Annot annot) throws com.foxit.sdk.PDFException
 交换当前注释与其下一个注释的索引。
更多...
 
void moveAnnotToPrev (Annot annot) throws com.foxit.sdk.PDFException
 交换当前注释与其前一个注释的索引。
更多...
 
boolean normalize () throws com.foxit.sdk.PDFException
 通过撤销任何旋转并移除到页面"CropBox"的偏移来转换当前PDF页面。
更多...
 
boolean removeAllWatermarks () throws com.foxit.sdk.PDFException
 移除所有水印。
更多...
 
boolean removeAnnot (Annot annot) throws com.foxit.sdk.PDFException
 移除注释。
更多...
 
boolean setAnnotGroup (MarkupArray annot_array, int header_index) throws com.foxit.sdk.PDFException
 将所有输入的标记注释组合在一起。
更多...
 
void setBox (int box_type, RectF box) throws com.foxit.sdk.PDFException
 设置页面框。
更多...
 
void setClipRect (RectF clip_rect) throws com.foxit.sdk.PDFException
 为当前PDF页面上的所有图形对象设置剪切矩形。
更多...
 
void setRotation (int rotate) throws com.foxit.sdk.PDFException
 设置页面旋转。
更多...
 
void setSize (float width, float height) throws com.foxit.sdk.PDFException
 设置页面宽度和高度。
更多...
 
void setSize (int size) throws com.foxit.sdk.PDFException
 设置页面大小类型。
更多...
 
void setThumbnail (Bitmap thumbnail) throws com.foxit.sdk.PDFException
 设置页面缩略图。
更多...
 
void setUserUnitSize (float user_unit) throws com.foxit.sdk.PDFException
 设置用户单位。
更多...
 
TextObjectArray splitTextsInRectangle (RectF rect, int split_step) throws com.foxit.sdk.PDFException
 分割文本对象,这些对象的矩形(在中)与指定的矩形 (在中)相交,并根据split_step进一步分割相交部分。
更多...
 
Progressive startParse (int flags, PauseCallback pause, boolean is_reparse) throws com.foxit.sdk.PDFException
 开始解析当前页面。
更多...
 
boolean transform (Matrix2D matrix, boolean need_transform_clip_path, boolean need_transform_annotations) throws com.foxit.sdk.PDFException
 转换PDF页面,包括页面上的注释和表单字段。
更多...
 
void updateAnnotList ()
 更新注释列表。
更多...
 
- Public 成员函数 继承自 com.foxit.sdk.pdf.GraphicsObjects
 GraphicsObjects (GraphicsObjects other)
 构造函数,使用另一个 GraphicsObjects 对象。
更多...
 
boolean generateContent () throws com.foxit.sdk.PDFException
 生成当前图形对象的内容。
更多...
 
boolean generateContent (int text_merge_option) throws com.foxit.sdk.PDFException
 生成当前图形对象的内容。
更多...
 
long getFirstGraphicsObjectPosition (int filter) throws com.foxit.sdk.PDFException
 获取图形对象列表中第一个图形对象的位置,基于类型过滤器。
更多...
 
GraphicsObject getGraphicsObject (int index) throws com.foxit.sdk.PDFException
 通过索引获取图形对象。
更多...
 
GraphicsObject getGraphicsObject (long position) throws com.foxit.sdk.PDFException
 通过图形对象列表中的位置获取图形对象。
更多...
 
int getGraphicsObjectCount () throws com.foxit.sdk.PDFException
 获取图形对象列表中图形对象的数量。
更多...
 
int getGraphicsObjectIndex (GraphicsObject graphics_object) throws com.foxit.sdk.PDFException
 获取指定图形对象在图形对象列表中的索引。
更多...
 
long getGraphicsObjectPosition (GraphicsObject graphics_object) throws com.foxit.sdk.PDFException
 获取指定图形对象的位置。
更多...
 
long getLastGraphicsObjectPosition (int filter) throws com.foxit.sdk.PDFException
 获取图形对象列表中最后一个图形对象的位置,基于类型过滤器。
更多...
 
long getNextGraphicsObjectPosition (long position, int filter) throws com.foxit.sdk.PDFException
 获取图形对象列表中下一个图形对象的位置, 基于类型过滤器和指定的当前位置。
更多...
 
long getPrevGraphicsObjectPosition (long position, int filter) throws com.foxit.sdk.PDFException
 获取图形对象列表中上一个图形对象的位置, 基于类型过滤器和指定的当前位置。
更多...
 
long insertGraphicsObject (long position_insert_after, GraphicsObject graphics_object) throws com.foxit.sdk.PDFException
 在指定位置后插入图形对象。
更多...
 
boolean isEmpty ()
 检查当前对象是否为空。
更多...
 
long moveGraphicsObjectByPosition (long current_position, long position_move_after) throws com.foxit.sdk.PDFException
 将图形对象从一个位置移动到另一个位置。
更多...
 
boolean removeGraphicsObject (GraphicsObject graphics_object) throws com.foxit.sdk.PDFException
 删除图形对象。
更多...
 
boolean removeGraphicsObjectByPosition (long position) throws com.foxit.sdk.PDFException
 通过位置删除图形对象。
更多...
 

静态 Public 属性

static final int e_ArtBox = 3
 页面边界的艺术框。
更多...
 
static final int e_BleedBox = 4
 页面边界的出血框。
更多...
 
static final int e_CalcContentsBox = 0
 根据所有内容的边界框计算边距。

 
static final int e_CalcDetection = 1
 通过检测路径或图像来计算边距。

 
static final int e_CropBox = 1
 页面边界的裁剪框。
更多...
 
static final int e_FlattenAll = 0
 扁平化PDF页面的所有内容。

 
static final int e_FlattenNoAnnot = 0x0001
 扁平化PDF页面但不包括注释。


 
static final int e_FlattenNoFormControl = 0x0002
 扁平化PDF页面但不包括表单控件。


 
static final int e_MediaBox = 0
 页面边界的媒体框。
更多...
 
static final int e_ParsePageNormal = 0x0000
 普通模式解析标志,表示解析PDF页面中的所有内容。

 
static final int e_ParsePageTextOnly = 0x0001
 纯文本模式解析标志。

 
static final int e_SizeA2 = 3
 页面尺寸:A2。

 
static final int e_SizeA3 = 4
 页面尺寸:A3。

 
static final int e_SizeA4 = 5
 页面尺寸:A4。

 
static final int e_SizeA5 = 6
 页面尺寸:A5。

 
static final int e_SizeA6 = 7
 页面尺寸:A6。

 
static final int e_SizeB2 = 8
 页面尺寸:B2。

 
static final int e_SizeB3 = 9
 页面尺寸:B3。

 
static final int e_SizeB4 = 10
 页面尺寸:B4。

 
static final int e_SizeB5 = 11
 页面尺寸:B5。

 
static final int e_SizeB6 = 12
 页面尺寸:B6。

 
static final int e_SizeLegal = 2
 页面尺寸:legal(法律用纸)。

 
static final int e_SizeLetter = 1
 页面尺寸:letter(信纸)。

 
static final int e_TrimBox = 2
 页面边界的修剪框。
更多...
 
- 静态 Public 属性 继承自 com.foxit.sdk.pdf.GraphicsObjects
static final int e_TextMergeBTET = 2
 将连续的BTET合并为新的一个。
更多...
 
static final int e_TextMergeNone = 0
 不进行文本合并。

 
static final int e_TextMergeTJY = 1
 合并具有相同y坐标的连续文本显示操作符。

 

详细描述

PDF页面在PDF坐标系统中定义,使用页面的左下角作为 原点(0, 0)。
通常,PDF页面对象通过函数PDFDoc.getPage 从PDF文档中获取。 对于大多数情况,PDF页面应该首先被解析然后才能使用。函数PDFPage.isParsed 可以 用于判断PDF页面是否已被解析。对于未解析的页面,请使用函数 PDFPage.startParse 来解析它。
此类提供获取/设置PDF页面数据的函数,如页面宽度/高度、页面旋转、 显示矩阵等。此外,此类还提供检索PDF注释的函数:

com.foxit.sdk.pdf.PDFPage 派生自类com.foxit.sdk.pdf.GraphicsObjects ,因此PDFPage类还提供检索PDF图形对象的函数: retrieve PDF graphics objects: 检索PDF图形对象:

This class object can also be used to construct objects of other classes in order to access specified information 此类对象也可用于构造其他类的对象,以便访问指定信息 in PDF page: 在PDF页面中:


参见
PDFDoc
GraphicsObjects
TextPage
ReflowPage
com.foxit.sdk.pdf.actions.AdditionalAction
TabOrderMgr

构造及析构函数说明

◆ PDFPage() [1/2]

com.foxit.sdk.pdf.PDFPage.PDFPage ( PDFDoc  document,
PDFDictionary  page_dict 
)

构造函数,从表示PDF页面的PDF字典和包含该字典的PDF文档创建。

参数
[in]document有效的PDF文档。
[in]page_dictPDF页面的PDF字典。它应该属于参数document指定的PDF文档。

◆ PDFPage() [2/2]

com.foxit.sdk.pdf.PDFPage.PDFPage ( GraphicsObjects  other)

构造函数,使用父类对象。

参数
[in]other父类对象。

成员函数说明

◆ addAnnot() [1/2]

Annot com.foxit.sdk.pdf.PDFPage.addAnnot ( int  type,
RectF  rect 
) throws com.foxit.sdk.PDFException

向当前PDF页面添加注释。

目前,此函数可以支持添加大多数注释类型,除了:
Widget、Sound、Movie、PrinterMark、TrapNet、Watermark、3D、PSInk、Redact。
注意:

  • 控件注释用于表示表单字段的外观, 包括签名字段:
    对于签名字段,可以调用函数 PDFPage.addSignature 来 添加新的签名对象。
    对于其他类型的表单字段,可以调用函数 interform.Form.addControl 来 添加新的表单字段(包含表单控件)。

  • PSInk注释应该通过函数 PSI.convertToPDFAnnot 从PSI对象转换而来。
  • 编辑注释应该通过函数 addon.Redaction.markRedactAnnot 添加来标记PDF页面中的区域。
  • 对于支持的注释类型,如果用户未设置新创建注释的任何属性 (除了必需属性)并且直接调用函数 annots.Annot.resetAppearanceStream ,将使用默认外观。请参考 具体注释类的注释以了解其默认外观的更多详细信息。


参数
[in]type要添加的注释类型。请参考从 com.foxit.sdk.pdf.annots.Annot.e_Note 开始的值,应该是这些值中的一个, 除了com.foxit.sdk.pdf.annots.Annot.e_PSInk com.foxit.sdk.pdf.annots.Annot.e_Sound com.foxit.sdk.pdf.annots.Annot.e_Movie com.foxit.sdk.pdf.annots.Annot.e_Widget com.foxit.sdk.pdf.annots.Annot.e_PrinterMark com.foxit.sdk.pdf.annots.Annot.e_TrapNet com.foxit.sdk.pdf.annots.Annot.e_Watermark com.foxit.sdk.pdf.annots.Annot.e_3D
[in]rect新注释的矩形区域。
返回
新创建的注释对象。

◆ addAnnot() [2/2]

Annot com.foxit.sdk.pdf.PDFPage.addAnnot ( PDFDictionary  annot_dict) throws com.foxit.sdk.PDFException

向当前PDF页面添加注释(通过有效的注释字典)。

参数
[in]annot_dict要作为注释添加到当前PDF页面的有效注释字典。
返回
新创建的注释对象。

◆ addImage()

boolean com.foxit.sdk.pdf.PDFPage.addImage ( Image  image,
int  frame_index,
PointF  position,
float  width,
float  height,
boolean  auto_generate_content 
) throws com.foxit.sdk.PDFException

添加图像到当前页面。

如果图像类型是 com.foxit.sdk.common.Image.e_JPG ,图像应该保持有效 直到相关文档关闭。

参数
[in]image图像。其中一个帧将被设置到当前页面。 此图像包含至少一个帧,图像类型不应为 com.foxit.sdk.common.Image.e_Unknown
[in]frame_index帧索引。有效范围:从 0 到 (count-1)。 count 由函数 common.Image.getFrameCount 返回。
[in]position指定位置,为图像对象的左下角,位于 中。
[in]width用于将图像设置到页面中的宽度(单位为 1/72 英寸)。 此值应大于 0。
[in]height用于将图像设置到页面中的高度(单位为 1/72 英寸)。 此值应大于 0。
[in]auto_generate_contenttrue 表示内部生成内容。
当使用 false 时,用户应确保在添加图像后调用函数 GraphicsObjects.generateContent 。 更多详情请参考函数 GraphicsObjects.generateContent 。 默认值:true
返回
true 表示成功,false 表示失败。

◆ addImageFromFilePath()

boolean com.foxit.sdk.pdf.PDFPage.addImageFromFilePath ( String  file_path,
PointF  position,
float  width,
float  height,
boolean  auto_generate_content 
) throws com.foxit.sdk.PDFException

从文件路径添加图像到当前页面。

如果输入图像(由文件路径指定)有多个帧,只有第一帧会被默认添加到 当前页面。

参数
[in]file_path现有图像文件的完整路径。不应为空字符串。
[in]position指定位置,为图像对象的左下角,位于 中。
[in]width用于将图像设置到页面中的宽度。 此值应大于 0。
[in]height用于将图像设置到页面中的高度。 此值应大于 0。
[in]auto_generate_contenttrue 表示内部生成内容。
当使用 false 时,用户应确保在添加图像后调用函数 GraphicsObjects.generateContent 。 更多详情请参考函数 GraphicsObjects.generateContent 。 默认值:true
返回
true 表示成功,false 表示失败。

◆ addSignature() [1/3]

Signature com.foxit.sdk.pdf.PDFPage.addSignature ( RectF  rect) throws com.foxit.sdk.PDFException

向PDF页面添加普通签名。

对于新的普通签名,其过滤器默认为"Adobe.PPKLite",子过滤器默认为"adbe.pkcs7.detached"。 有关签名过滤器和子过滤器的更多详细信息,请参考类 Signature
在对新签名进行签名之前,用户还可以调用类 Signature 的设置函数 来设置用于签名和签名外观的其他信息。

参数
[in]rect新签名的矩形位置,在 中。 它应该是 中的有效矩形。
返回
新添加的签名对象。

◆ addSignature() [2/3]

Signature com.foxit.sdk.pdf.PDFPage.addSignature ( RectF  rect,
String  field_name 
) throws com.foxit.sdk.PDFException

向PDF页面添加普通签名。

对于新的普通签名,其过滤器默认为"Adobe.PPKLite",子过滤器默认为"adbe.pkcs7.detached"。 有关签名过滤器和子过滤器的更多详细信息,请参考类 Signature
在对新签名进行签名之前,用户还可以调用类 Signature 的设置函数 来设置用于签名和签名外观的其他信息。

参数
[in]rect新签名的矩形位置,在 中。 它应该是 中的有效矩形。
[in]field_name签名字段名称。这可以是空字符串。
返回
新添加的签名对象。

◆ addSignature() [3/3]

Signature com.foxit.sdk.pdf.PDFPage.addSignature ( RectF  rect,
String  field_name,
int  signature_type,
boolean  to_check_permission 
) throws com.foxit.sdk.PDFException

向PDF页面添加签名。

对于新的普通签名,其过滤器默认为"Adobe.PPKLite",子过滤器默认为"adbe.pkcs7.detached"。 对于新的时间戳签名,其过滤器默认为"Adobe.PPKLite",子过滤器默认为"ETSI.RFC3161"。 有关签名过滤器和子过滤器的更多详细信息,请参考类 Signature
在对新签名进行签名之前,用户还可以调用类 Signature 的设置函数 来设置用于签名和签名外观的其他信息。

参数
[in]rect新签名的矩形位置,在 中。 如果参数 signature_typecom.foxit.sdk.pdf.Signature.e_SignatureTypeTimeStamp , 此矩形将被忽略;否则,这应该是 中的有效矩形。
[in]field_name签名字段名称。可以是空字符串。
[in]signature_type签名类型。请参考从 com.foxit.sdk.pdf.Signature.e_SignatureTypeOrdinary 开始的值, 应该是这些值中的一个。
[in]to_check_permission一个布尔值,决定 Foxit PDF SDK 是否应在添加签名前检查 PDF 文档的权限: true 表示 Foxit PDF SDK 应检查文档权限以决定是否允许添加签名, false 表示 Foxit PDF SDK 不应在添加签名前检查文档权限。 当此参数为 false 时,用户应确保检查文档权限以检查是否允许添加签名。 默认值:true
返回
新添加的签名对象。

◆ addSignatureWithExistedVDict()

Signature com.foxit.sdk.pdf.PDFPage.addSignatureWithExistedVDict ( RectF  rect,
String  field_name,
int  signature_type,
boolean  to_check_permission,
Signature  existed_signature 
) throws com.foxit.sdk.PDFException

使用特定签名中已存在的"V"字典添加签名到 PDF 页面。

对于新的普通签名,其过滤器默认为"Adobe.PPKLite",子过滤器默认为"adbe.pkcs7.detached"。 对于新的时间戳签名,其过滤器默认为"Adobe.PPKLite",子过滤器默认为"ETSI.RFC3161"。 有关签名过滤器和子过滤器的更多详情,请参考类 Signature
在签署新签名之前,用户还可以调用类 Signature 的设置函数 来设置用于签署和签名外观的其他信息。 共享 V 字典后,对与 V 字典相关的条目的任何更改都将同时 影响所有共享 V 字典的签名的外观。

参数
[in]rect新签名的矩形位置,在 中。 如果参数 signature_typecom.foxit.sdk.pdf.Signature.e_SignatureTypeTimeStamp , 此矩形将被忽略;否则,这应该是 中的有效矩形。
[in]field_name签名字段名称。这可以是空字符串。
[in]signature_type签名类型。请参考从 com.foxit.sdk.pdf.Signature.e_SignatureTypeOrdinary 开始的值,这应该是这些值中的一个。
[in]to_check_permission一个布尔值,决定Foxit PDF SDK是否应在添加签名前检查PDF文档的权限: true 表示Foxit PDF SDK应检查文档权限以决定是否允许添加签名, false 表示Foxit PDF SDK不应在添加签名前检查文档权限。 当此参数为 false 时,用户应确保检查文档权限以确认是否允许添加签名。 默认值:true
[in]existed_signature其"V"字典将在新添加的签名中使用的签名。
返回
新添加的签名对象。

◆ addText() [1/2]

RectF com.foxit.sdk.pdf.PDFPage.addText ( String  text,
RectF  rect,
RichTextStyle  style,
int  rotation,
int  rotate_point,
boolean  disable_embed_font 
) throws com.foxit.sdk.PDFException

添加文本到当前页面。

如果文本太长无法适合矩形,文本会自动换行。

参数
[in]text新文本字符串的内容。不应为空字符串。
[in]rect框矩形,位于 中。
[in]style用于新文本字符串的样式数据。
[in]rotation新文本字符串的旋转值。
[in]rotate_point旋转参考点。请参考从 com.foxit.sdk.common.Constants.e_RotationPointCenter 开始的值, 应该是这些值中的一个。

[in]disable_embed_font一个布尔值,表示是否禁用嵌入字体。 true 表示禁用嵌入字体,false 表示不禁用。
返回
文本块内容的矩形。
注解
此函数成功时,应调用函数 GraphicsObjects.generateContent 。 更多详情请参考函数 GraphicsObjects.generateContent

◆ addText() [2/2]

boolean com.foxit.sdk.pdf.PDFPage.addText ( String  text,
RectF  rect,
RichTextStyle  style,
Matrix2D  matrix,
boolean  is_each_text,
boolean  disable_embed_font 
) throws com.foxit.sdk.PDFException

添加文本到当前页面。

如果文本太长无法适合矩形,文本会自动换行。

参数
[in]text新文本字符串的内容。不应为空字符串。
[in]rect框矩形,位于 中。
[in]style用于新文本字符串的样式数据。
[in]matrix用于添加文本块的变换矩阵。
[in]is_each_text一个布尔值,指示是否为文本块内的每个文本对象单独应用变换矩阵。 true 表示为每个文本对象使用单独的矩阵, false 表示为整个文本块使用相同的矩阵。
[in]disable_embed_font一个布尔值,表示是否禁用嵌入字体。 true 表示禁用嵌入字体,false 表示不禁用。
返回
true 表示成功,false 表示失败。
注解
此函数成功时,应调用函数 GraphicsObjects.generateContent 。 更多详情请参考函数 GraphicsObjects.generateContent

◆ calcContentBBox()

RectF com.foxit.sdk.pdf.PDFPage.calcContentBBox ( int  mode) throws com.foxit.sdk.PDFException

计算PDF页面的内容区域。

在使用此函数之前,请确保当前页面已被解析。

参数
[in]mode计算模式。它应该是以下值之一:
返回
包含可见页面内容的最小矩形。

◆ calculateNewRectForText()

RectF com.foxit.sdk.pdf.PDFPage.calculateNewRectForText ( String  text,
RectF  rect,
RichTextStyle  style,
int  rotation,
int  rotate_point,
boolean  disable_embed_font 
) throws com.foxit.sdk.PDFException

计算新文本矩形。

参数
[in]text新文本字符串的内容。不应为空字符串。
[in]rect框矩形,位于 中。
[in]style用于新文本字符串的样式数据。
[in]rotation新文本字符串的旋转值。
[in]rotate_point旋转参考点。请参考从 com.foxit.sdk.common.Constants.e_RotationPointCenter 开始的值, 应该是这些值中的一个。
[in]disable_embed_font一个布尔值,表示是否禁用嵌入字体。 true 表示禁用嵌入字体,false 表示不禁用。
返回
文本块内容的矩形。

◆ clearRenderCache()

void com.foxit.sdk.pdf.PDFPage.clearRenderCache ( )

清除渲染缓存。

返回
无。

◆ delete()

synchronized void com.foxit.sdk.pdf.PDFPage.delete ( )

直接清除C++相关资源。

返回
无。
注解
一旦这个接口被调用,这个对象将不能再被使用。

重载 com.foxit.sdk.pdf.GraphicsObjects .

◆ flatten()

boolean com.foxit.sdk.pdf.PDFPage.flatten ( boolean  for_display,
int  options 
) throws com.foxit.sdk.PDFException

拼合当前PDF页面:根据指定选项,注释或表单字段可能成为页面内容的一部分。

注释标志可以决定注释是否可以显示或是否可以打印。 这也会影响拼合结果:

  • 如果拼合结果用于显示,只有可以显示的注释 才会被拼合成为页面内容的一部分。
  • 如果拼合结果用于打印,只有可以打印的注释 才会被拼合成为页面内容的一部分。

表单字段的外观由控件注释表示,控件注释是一种注释,在Foxit PDF SDK中 被视为表单控件。因此,当表单字段要被拼合时,注释标志也会影响表单字段。 有关注释标志的更多详细信息,请参考从 com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible 开始的值 以及<PDF参考1.7>中的第8.4.2节"注释标志"。
注释或表单字段被拼合后,它将不再是注释或表单字段。 成功拼合当前页面后,用户应通过函数 PDFPage.startParse 重新解析此页面。

参数
[in]for_display决定拼合结果的用途: true 表示拼合结果仅用于显示, false 表示拼合结果仅用于打印。
[in]options拼合选项。请参考从 com.foxit.sdk.pdf.PDFPage.e_FlattenAll 开始的值, 这应该是其中一个或它们的组合。
特别地,如果同时使用 com.foxit.sdk.pdf.PDFPage.e_FlattenNoAnnot com.foxit.sdk.pdf.PDFPage.e_FlattenNoFormControl , 这意味着没有任何内容要拼合到页面,此函数将 直接返回 true。 默认值:com.foxit.sdk.pdf.PDFPage.e_FlattenAll
返回
true 表示当前页面拼合成功,false 表示失败。

◆ flattenAnnot()

boolean com.foxit.sdk.pdf.PDFPage.flattenAnnot ( Annot  annot) throws com.foxit.sdk.PDFException

拼合注释:将注释合并到页面内容中,然后将其移除。

成功拼合注释后,用户应通过函数 PDFPage.startParse 重新解析此页面。

参数
[in]annot要拼合和移除的注释。
返回
true 表示成功,false 表示失败。

◆ getAnnot()

Annot com.foxit.sdk.pdf.PDFPage.getAnnot ( int  index) throws com.foxit.sdk.PDFException

通过索引获取注释。

参数
[in]index注释索引。有效范围:从0到(count-1)。 count由函数PDFPage.getAnnotCount 返回。
返回
注释对象。

◆ getAnnotAtDevicePoint()

Annot com.foxit.sdk.pdf.PDFPage.getAnnotAtDevicePoint ( PointF  position,
float  tolerance,
Matrix2D  matrix 
) throws com.foxit.sdk.PDFException

获取指定位置的注释,在设备坐标系统中。

如果在此指定位置有多个注释,此函数将始终返回 最顶层的注释。具有标志com.foxit.sdk.pdf.annots.Annot.e_FlagNoView com.foxit.sdk.pdf.annots.Annot.e_FlagHidden com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible 的注释不会被此函数检索。如果返回的注释有标志 com.foxit.sdk.pdf.annots.Annot.e_FlagReadOnly ,则无法修改。

参数
[in]position指定位置,在设备坐标系统中。
[in]tolerance容差值。有效范围:0.0f到30.0f。
[in]matrix变换矩阵。通常这由函数 PDFPage.getDisplayMatrix 返回。如果这是null,当前函数将 具有与函数PDFPage.getAnnotAtPoint 相同的功能。 默认值:null
返回
注释对象。如果返回注释对象的函数annots.Annot.isEmpty 的返回值为true,表示找不到PDF注释。

◆ getAnnotAtPoint()

Annot com.foxit.sdk.pdf.PDFPage.getAnnotAtPoint ( PointF  position,
float  tolerance 
) throws com.foxit.sdk.PDFException

获取指定位置的注释,在中。

如果在此指定位置有多个注释,此函数将始终返回 最顶层的注释。具有标志com.foxit.sdk.pdf.annots.Annot.e_FlagNoView com.foxit.sdk.pdf.annots.Annot.e_FlagHidden com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible 的注释不会被此函数检索。如果返回的注释有标志 com.foxit.sdk.pdf.annots.Annot.e_FlagReadOnly ,则无法修改。

参数
[in]position指定位置,在中。
[in]tolerance容差值。有效范围:0.0f到30.0f。
返回
注释对象。如果返回注释对象的函数annots.Annot.isEmpty 的返回值为true,表示找不到PDF注释。

◆ getAnnotCount()

int com.foxit.sdk.pdf.PDFPage.getAnnotCount ( ) throws com.foxit.sdk.PDFException

获取注释的数量。

返回
注释的数量。

◆ getAnnots()

PDFArray com.foxit.sdk.pdf.PDFPage.getAnnots ( ) throws com.foxit.sdk.PDFException

获取"Annots"的 PDF 数组。

注解
更多详情请参考 <PDF Reference 1.7> P147 中的"TABLE 3.27 Entries in a page object"。
返回
"Annots"的 PDF 数组。 如果没有"Annots"条目或发生任何错误,此函数将返回 null

◆ getAnnotsAtDevicePoint()

AnnotArray com.foxit.sdk.pdf.PDFPage.getAnnotsAtDevicePoint ( PointF  position,
float  tolerance,
Matrix2D  matrix 
) throws com.foxit.sdk.PDFException

获取指定位置的所有注释,在设备坐标系统中。

在一个指定位置,可能存在多个注释。 此函数可用于检索指定位置的所有这些注释。 具有标志com.foxit.sdk.pdf.annots.Annot.e_FlagNoView com.foxit.sdk.pdf.annots.Annot.e_FlagHidden com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible 的注释不会被此函数检索。
如果返回注释数组对象的函数annots.AnnotArray.getAt 的返回注释对象 有标志com.foxit.sdk.pdf.annots.Annot.e_FlagReadOnly ,表示该注释 无法修改。

参数
[in]position指定位置,在设备坐标系统中。
[in]tolerance容差值。有效范围:0.0f到30.0f。
[in]matrix变换矩阵。通常这由函数 PDFPage.getDisplayMatrix 返回。如果这是null,当前函数将 具有与函数PDFPage.getAnnotAtPoint 相同的功能。 默认值:null
返回
注释数组。如果返回注释数组对象的函数annots.AnnotArray.getSize 的返回值为0,表示找不到PDF注释。

◆ getAnnotsAtPoint()

AnnotArray com.foxit.sdk.pdf.PDFPage.getAnnotsAtPoint ( PointF  position,
float  tolerance 
) throws com.foxit.sdk.PDFException

获取指定位置的所有注释,在中。

在一个指定位置,可能存在多个注释。 此函数可用于检索指定位置的所有这些注释。 具有标志com.foxit.sdk.pdf.annots.Annot.e_FlagNoView com.foxit.sdk.pdf.annots.Annot.e_FlagHidden com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible 的注释不会被此函数检索。
如果返回注释数组对象的函数annots.AnnotArray.getAt 的返回注释对象 有标志com.foxit.sdk.pdf.annots.Annot.e_FlagReadOnly ,表示该注释 无法修改。

参数
[in]position指定位置,在中。
[in]tolerance容差值。有效范围:0.0f到30.0f。
返回
注释数组。如果返回注释数组对象的函数annots.AnnotArray.getSize 的返回值为0,表示找不到PDF注释。

◆ getBox()

RectF com.foxit.sdk.pdf.PDFPage.getBox ( int  box_type) throws com.foxit.sdk.PDFException

获取页面框。

参数
[in]box_type页面框类型。请参考从 com.foxit.sdk.pdf.PDFPage.e_MediaBox 开始的值, 这应该是这些值中的一个。
返回
一个框矩形,在 中。

◆ getContents()

PDFObject com.foxit.sdk.pdf.PDFPage.getContents ( ) throws com.foxit.sdk.PDFException

获取"Contents"的 PDF 对象。

注解
"Contents"可以是 PDF 流或 PDF 数组。更多详情请参考 <PDF Reference 1.7> P146 中的 "TABLE 3.27 Entries in a page object"。
返回
"Contents"的 PDF 对象。 如果没有"Contents"条目或发生任何错误,此函数将返回 null

◆ getDict()

PDFDictionary com.foxit.sdk.pdf.PDFPage.getDict ( ) throws com.foxit.sdk.PDFException

获取页面字典。

返回
页面字典对象。如果有任何错误,此函数将返回 null

◆ getDisplayMatrix()

Matrix2D com.foxit.sdk.pdf.PDFPage.getDisplayMatrix ( int  left,
int  top,
int  width,
int  height,
int  rotate 
) throws com.foxit.sdk.PDFException

获取PDF页面的显示矩阵,从到 目标设备坐标系统。

参数
[in]left设备坐标系统中变换区域的左侧位置,通常以像素为单位。
[in]top设备坐标系统中变换区域的顶部位置,通常以像素为单位。
[in]width设备坐标系统中变换区域的宽度,通常以像素为单位。
[in]height设备坐标系统中变换区域的高度,通常以像素为单位。
[in]rotate旋转值。请参考从com.foxit.sdk.common.Constants.e_Rotation0 开始的值, 这应该是这些值中的一个,除了com.foxit.sdk.common.Constants.e_RotationUnknown
返回
用于当前PDF页面的显示矩阵。

◆ getDocument()

PDFDoc com.foxit.sdk.pdf.PDFPage.getDocument ( ) throws com.foxit.sdk.PDFException

获取当前PDF页面所属的PDF文档。

返回
一个PDF文档对象。

◆ getGraphicsObjectAtDevicePoint()

GraphicsObject com.foxit.sdk.pdf.PDFPage.getGraphicsObjectAtDevicePoint ( PointF  point,
float  tolerance,
Matrix2D  matrix,
int  filter 
) throws com.foxit.sdk.PDFException

获取设备坐标系统中指定点的最顶层图形对象,使用指定的类型过滤器。

参数
[in]point指定位置,在设备坐标系统中。
[in]tolerance图形对象命中检测的容差值,以点为单位。它应该是正值。
[in]matrix转换矩阵。通常这是由函数 PDFPage.getDisplayMatrix 返回的。 默认值:null
[in]filter指定要获取的图形对象类型的类型过滤器。 请参考从 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 开始的值, 这应该是这些值中的一个。 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 表示所有类型的图形对象。 默认值:com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll
返回
一个 com.foxit.sdk.pdf.graphics.GraphicsObject 对象。如果找不到图形对象,此函数将返回 null

◆ getGraphicsObjectAtPoint()

GraphicsObject com.foxit.sdk.pdf.PDFPage.getGraphicsObjectAtPoint ( PointF  point,
float  tolerance,
int  filter 
) throws com.foxit.sdk.PDFException

获取指定点的最顶层图形对象,使用指定的类型过滤器。

参数
[in]point指定位置,在 中。
[in]tolerance图形对象命中检测的容差值,以点为单位。它应该是正值。
[in]filter指定要获取的图形对象类型的类型过滤器。 请参考从 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 开始的值, 这应该是这些值中的一个。 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 表示所有类型的图形对象。 默认值:com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll
返回
一个 com.foxit.sdk.pdf.graphics.GraphicsObject 对象。如果找不到图形对象,此函数将返回 null

◆ getGraphicsObjectAtRectangle()

GraphicsObject com.foxit.sdk.pdf.PDFPage.getGraphicsObjectAtRectangle ( RectF  rect,
int  filter 
) throws com.foxit.sdk.PDFException

获取矩形与指定矩形相交的最顶层图形对象,使用指定的类型过滤器。

参数
[in]rect指定的矩形,位于 中。
[in]filter类型过滤器,指定要获取哪种图形对象。 请参考从 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 开始的值, 应该是这些值中的一个。 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 表示所有类型的图形对象。 默认值:com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll
返回
矩形与指定矩形相交的图形对象。 如果找不到合适的图形对象,此函数将返回 null

◆ getGraphicsObjectsAtDevicePoint()

GraphicsObjectArray com.foxit.sdk.pdf.PDFPage.getGraphicsObjectsAtDevicePoint ( PointF  point,
float  tolerance,
Matrix2D  matrix,
int  filter 
) throws com.foxit.sdk.PDFException

获取设备坐标系统中指定点的所有图形对象,使用指定的类型过滤器。

参数
[in]point指定位置,在设备坐标系统中。
[in]tolerance图形对象命中检测的容差值,以点为单位。它应该是正值。
[in]matrix转换矩阵。通常这是由函数 PDFPage.getDisplayMatrix 返回的矩阵。 默认值:null
[in]filter类型过滤器,指定要获取哪种图形对象。 请参考从 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 开始的值, 应该是这些值中的一个。 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 表示所有类型的图形对象。 默认值:com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll
返回
com.foxit.sdk.pdf.graphics.GraphicsObject 对象数组。

◆ getGraphicsObjectsAtPoint()

GraphicsObjectArray com.foxit.sdk.pdf.PDFPage.getGraphicsObjectsAtPoint ( PointF  point,
float  tolerance,
int  filter 
) throws com.foxit.sdk.PDFException

获取指定点的所有图形对象,使用指定的类型过滤器。

参数
[in]point指定位置,在 中。
[in]tolerance图形对象命中检测的容差值,以点为单位。它应该是正值。
[in]filter指定要获取的图形对象类型的类型过滤器。 请参考从 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 开始的值, 这应该是这些值中的一个。 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 表示所有类型的图形对象。 默认值:com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll
返回
com.foxit.sdk.pdf.graphics.GraphicsObject 对象的数组。

◆ getGraphicsObjectsAtRectangle()

GraphicsObjectArray com.foxit.sdk.pdf.PDFPage.getGraphicsObjectsAtRectangle ( RectF  rect,
int  filter 
) throws com.foxit.sdk.PDFException

获取矩形与指定矩形相交的所有图形对象,使用指定的类型过滤器。

参数
[in]rect指定的矩形,位于 中。
[in]filter类型过滤器,指定要获取哪种图形对象。 请参考从 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 开始的值, 应该是这些值中的一个。 com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll 表示所有类型的图形对象。 默认值:com.foxit.sdk.pdf.graphics.GraphicsObject.e_TypeAll
返回
矩形与指定矩形相交的图形对象数组。

◆ getHeight()

float com.foxit.sdk.pdf.PDFPage.getHeight ( ) throws com.foxit.sdk.PDFException

获取页面高度(单位是1/72英寸)。

返回
页面高度。

◆ getIndex()

int com.foxit.sdk.pdf.PDFPage.getIndex ( ) throws com.foxit.sdk.PDFException

获取页面索引。

返回
页面索引,从0开始,在相关PDF文档的页面数范围内。

◆ getInheritedAttribute()

PDFObject com.foxit.sdk.pdf.PDFPage.getInheritedAttribute ( String  attruibute_name) throws com.foxit.sdk.PDFException

获取指定属性的 PDF 对象,该属性可能从页面树中的祖先节点继承。

某些页面属性被指定为可继承的,如"Resources"、"MediaBox"、"CropBox" 和"Rotate"。更多详情请参考 <PDF Reference 1.7> P145 中的"TABLE 3.27 Entries in a page object" 和 <PDF Reference 1.7> P149 中的"Inheritance of Page Attributes"。

参数
[in]attruibute_name要查找的属性名称。
返回
PDF 对象。如果未找到,此函数将返回 null

◆ getResources()

PDFDictionary com.foxit.sdk.pdf.PDFPage.getResources ( ) throws com.foxit.sdk.PDFException

获取"Resources"的 PDF 字典。

注解
更多详情请参考 <PDF Reference 1.7> P145 中的"TABLE 3.27 Entries in a page object"。
返回
"Resources"的 PDF 字典。 如果没有"Resources"条目或发生任何错误,此函数将返回 null

◆ getRotation()

int com.foxit.sdk.pdf.PDFPage.getRotation ( ) throws com.foxit.sdk.PDFException

获取页面旋转。

返回
页面旋转值。请参考从com.foxit.sdk.common.Constants.e_Rotation0 开始的值, 这将是这些值中的一个。

◆ getSuggestedRect()

RectF com.foxit.sdk.pdf.PDFPage.getSuggestedRect ( Bitmap  render_result,
Matrix2D  render_matrix,
PointF  point 
) throws com.foxit.sdk.PDFException

基于渲染结果位图为点(位于 )获取建议的矩形(位于 )。

此函数可以帮助用户在指定点周围定位矩形区域(作为建议矩形)。当检索到有效的建议矩形时, 用户可以使用该矩形向 PDF 页面添加内容,例如新的注释、新的表单字段、新的签名等。
点的建议矩形是指包含指定点的矩形,并且可以在指定点周围的空白位置尽可能大地绘制。 但是,如果从该点向左/右/上/下任何方向直接到达输入位图边缘,则无法检索到建议矩形。
此函数不支持 Rbg565 位图。如果输入位图是 Rbg565 位图,此函数将直接返回空矩形。

参数
[in]render_result作为渲染当前 PDF 页面结果的位图。这应该是有效的位图对象。
[in]render_matrix用于渲染当前 PDF 页面并生成参数 render_result 作为渲染结果的变换矩阵。
[in]point要为其查找建议矩形的点(位于 )。
返回
中的建议矩形。如果返回的矩形对象的函数 RectF::IsEmpty 返回值为 true,表示找不到合适的建议矩形。

◆ getThumb()

PDFStream com.foxit.sdk.pdf.PDFPage.getThumb ( ) throws com.foxit.sdk.PDFException

获取"Thumb"的 PDF 流。

注解
更多详情请参考 <PDF Reference 1.7> P146 中的"TABLE 3.27 Entries in a page object"。
返回
"Thumb"的 PDF 流。 如果没有"Thumb"条目或发生任何错误,此函数将返回 null

◆ getUserUnitSize()

float com.foxit.sdk.pdf.PDFPage.getUserUnitSize ( ) throws com.foxit.sdk.PDFException

获取用户单位。

一个正数,给出默认用户空间单位的大小,以1/72英寸的倍数表示。 支持值的范围取决于实现。

返回
用户单位。

◆ getWidth()

float com.foxit.sdk.pdf.PDFPage.getWidth ( ) throws com.foxit.sdk.PDFException

获取页面宽度(单位是1/72英寸)。

返回
页面宽度。

◆ hasTransparency()

boolean com.foxit.sdk.pdf.PDFPage.hasTransparency ( ) throws com.foxit.sdk.PDFException

检查当前PDF页面是否具有透明度。

在使用此函数之前,请确保当前页面已被解析。

返回
true 表示当前页面具有透明度, false 表示当前页面不具有透明度。

◆ hasWatermark()

boolean com.foxit.sdk.pdf.PDFPage.hasWatermark ( ) throws com.foxit.sdk.PDFException

检查当前页面是否有水印(不包括Foxit PDF SDK试用水印)。

在使用此函数之前,请确保当前页面已被解析。

返回
true 表示当前页面有水印,false 表示 当前页面没有水印。

◆ isParsed()

boolean com.foxit.sdk.pdf.PDFPage.isParsed ( ) throws com.foxit.sdk.PDFException

检查当前页面是否已被解析。

返回
true 表示当前页面已被解析, false 表示当前页面尚未被解析。

◆ isScanned()

boolean com.foxit.sdk.pdf.PDFPage.isScanned ( ) throws com.foxit.sdk.PDFException

检查当前PDF页面是否为扫描页面。

在使用此函数之前,请确保当前页面已被解析。

返回
true 表示当前页面是扫描页面, false 表示当前页面不是扫描页面。

◆ loadThumbnail()

Bitmap com.foxit.sdk.pdf.PDFPage.loadThumbnail ( ) throws com.foxit.sdk.PDFException

加载缩略图位图。

返回
当前页面的缩略图位图。如果返回位图对象的函数common.Bitmap.isEmpty 的返回值为true,表示找不到缩略图。

◆ moveAnnotToFirst()

void com.foxit.sdk.pdf.PDFPage.moveAnnotToFirst ( Annot  annot) throws com.foxit.sdk.PDFException

将指定注释更改为所有注释中的第一个。

在PDF页面中,所有注释都在注释列表中管理。在注释列表中, 具有较小索引(位于列表前部)的注释将首先绘制到页面上, 具有较大索引(位于列表后部)的注释将稍后绘制到页面上。 因此,在页面中,如果一个注释在z顺序中显示在其他注释之上,这意味着 它的索引比注释列表中的其他注释更大。
此函数用于将注释从当前索引位置移动到注释列表中的第一个位置, 以便在显示时将注释移动到z顺序的底部。

参数
[in]annot要移动到第一位的注释对象。它应该在当前PDF页面中。
返回
无。

◆ moveAnnotToLast()

void com.foxit.sdk.pdf.PDFPage.moveAnnotToLast ( Annot  annot) throws com.foxit.sdk.PDFException

将指定注释更改为所有注释中的最后一个。

在PDF页面中,所有注释都在注释列表中管理。在注释列表中, 具有较小索引(位于列表前部)的注释将首先绘制到页面上, 具有较大索引(位于列表后部)的注释将稍后绘制到页面上。 因此,在页面中,如果一个注释在z顺序中显示在其他注释之上,这意味着 它的索引比注释列表中的其他注释更大。
此函数用于将注释从当前索引位置移动到注释列表中的最后位置, 以便在显示时将注释移动到z顺序的顶部。

参数
[in]annot要移动到最后位的注释对象。它应该在当前PDF页面中。
返回
无。

◆ moveAnnotToNext()

void com.foxit.sdk.pdf.PDFPage.moveAnnotToNext ( Annot  annot) throws com.foxit.sdk.PDFException

交换当前注释与其下一个注释的索引。

在PDF页面中,所有注释都在注释列表中管理。在注释列表中, 具有较小索引(位于列表前部)的注释将首先绘制到页面上, 具有较大索引(位于列表后部)的注释将稍后绘制到页面上。 因此,在页面中,如果一个注释在z顺序中显示在其他注释之上,这意味着 它的索引比注释列表中的其他注释更大。
此函数用于交换当前注释与其下一个注释的索引位置 在注释列表中,以便在显示时将注释移动到z顺序中的较高级别。

参数
[in]annot要移动的注释对象。它应该在当前PDF页面中。
返回
无。

◆ moveAnnotToPrev()

void com.foxit.sdk.pdf.PDFPage.moveAnnotToPrev ( Annot  annot) throws com.foxit.sdk.PDFException

交换当前注释与其前一个注释的索引。

在PDF页面中,所有注释都在注释列表中管理。在注释列表中, 具有较小索引(位于列表前部)的注释将首先绘制到页面上, 具有较大索引(位于列表后部)的注释将稍后绘制到页面上。 因此,在页面中,如果一个注释在z顺序中显示在其他注释之上,这意味着 它的索引比注释列表中的其他注释更大。
此函数用于交换当前注释与其前一个注释的索引位置 在注释列表中,以便在显示时将注释移动到z顺序中的较低级别。

参数
[in]annot要移动的注释对象。它应该在当前PDF页面中。
返回
无。

◆ normalize()

boolean com.foxit.sdk.pdf.PDFPage.normalize ( ) throws com.foxit.sdk.PDFException

通过撤销任何旋转并移除到页面"CropBox"的偏移来转换当前PDF页面。

返回
true 表示成功,false 表示失败。
注解
注释和表单字段也会被调整以保持在PDF页面上的相同相对位置。 这使得向PDF页面添加新项目变得更容易,因为坐标系统将相对于 可见页面的左下角。

◆ removeAllWatermarks()

boolean com.foxit.sdk.pdf.PDFPage.removeAllWatermarks ( ) throws com.foxit.sdk.PDFException

移除所有水印。

在使用此函数之前,请确保当前页面已被解析。

返回
true 表示成功,false 表示失败。

◆ removeAnnot()

boolean com.foxit.sdk.pdf.PDFPage.removeAnnot ( Annot  annot) throws com.foxit.sdk.PDFException

移除注释。

此函数可以移除任何通过获取函数或添加函数返回的注释。
但对于控件注释,此函数只能移除独立的控件注释。 如果控件注释与表单字段关联,此函数无法移除它并且 会抛出异常com.foxit.sdk.common.Constants.e_ErrUnsupported
对于与表单字段关联的控件注释,请调用函数 interform.Form.removeControl 来移除它及其关联的表单控件。

参数
[in]annot要移除的注释对象。它应该在当前PDF页面中。
返回
true表示成功,false表示失败。

◆ setAnnotGroup()

boolean com.foxit.sdk.pdf.PDFPage.setAnnotGroup ( MarkupArray  annot_array,
int  header_index 
) throws com.foxit.sdk.PDFException

将所有输入的标记注释组合在一起。

标记注释可以被分组。组由一个主注释和一个或 多个从属注释组成。主注释中的某些条目被视为组属性, 应该适用于整个组;从属注释中相应的条目 应该被忽略。这些条目包括内容、最后修改时间、填充颜色/边框颜色、 标题、弹出注释、创建时间、主题和打开状态。因此用户应该 尊重组属性:当组中注释的属性被更改时, 同一组中的其他注释也应该被更改。
操作组中任何注释的操作,如移动、剪切和复制,应该被 查看器应用程序视为作用于整个组。

参数
[in]annot_array一个标记对象数组,指定要 组合在一起的标记注释。此数组应至少包含 2个标记注释,并且此数组中的所有标记注释应该 彼此不同。此数组中的所有标记注释应该 在当前页面中。
特别地,如果此数组中的标记注释已经在另一个组中, 该组将被设置为具有新标题的新组。
[in]header_index指定参数 annot_array 中标记注释的索引, 作为组的标题。有效范围:从 0 到 (annot_count -1)。
返回
true 表示成功将输入的标记注释组合在一起,false 表示失败。

◆ setBox()

void com.foxit.sdk.pdf.PDFPage.setBox ( int  box_type,
RectF  box 
) throws com.foxit.sdk.PDFException

设置页面框。

参数
[in]box_type页面框类型。请参考从 com.foxit.sdk.pdf.PDFPage.e_MediaBox 开始的值, 这应该是这些值中的一个。
[in]box新的框矩形,在 中。
返回
无。

◆ setClipRect()

void com.foxit.sdk.pdf.PDFPage.setClipRect ( RectF  clip_rect) throws com.foxit.sdk.PDFException

为当前PDF页面上的所有图形对象设置剪切矩形。

此函数成功完成后,请通过函数 PDFPage.startParse 重新解析当前页面,参数 is_reparsetrue

参数
[in]clip_rect新的剪切矩形,在 中。
返回
无。

◆ setRotation()

void com.foxit.sdk.pdf.PDFPage.setRotation ( int  rotate) throws com.foxit.sdk.PDFException

设置页面旋转。

参数
[in]rotate新的页面旋转值。请参考从 com.foxit.sdk.common.Constants.e_Rotation0 开始的值, 这应该是这些值中的一个,除了 com.foxit.sdk.common.Constants.e_RotationUnknown
返回
无。

◆ setSize() [1/2]

void com.foxit.sdk.pdf.PDFPage.setSize ( float  width,
float  height 
) throws com.foxit.sdk.PDFException

设置页面宽度和高度。

当改变页面宽度/高度时,Foxit PDF SDK总是按以下方式操作:
首先,选择"页面旋转为0"作为基准页面状态,选择 页面的左下角(页面旋转为0时)作为基准点。 然后,总是改变顶部页面边界和右侧页面边界的位置 (页面旋转为0时)来改变页面大小。

参数
[in]width新的页面宽度。它应该是正值,单位是1/72英寸。
[in]height新的页面高度。它应该是正值,单位是1/72英寸。
返回
无。

◆ setSize() [2/2]

void com.foxit.sdk.pdf.PDFPage.setSize ( int  size) throws com.foxit.sdk.PDFException

设置页面大小类型。

当改变页面大小时,Foxit PDF SDK总是按以下方式操作:
首先,选择"页面旋转为0"作为基准页面状态,选择 页面的左下角(页面旋转为0时)作为基准点。 然后,总是改变顶部页面边界和右侧页面边界的位置 (页面旋转为0时)来改变页面大小。

参数
[in]size指定当前页面新大小的大小类型。请参考从 com.foxit.sdk.pdf.PDFPage.e_SizeLetter 开始的值,这应该是这些值中的一个。
返回
无。

◆ setThumbnail()

void com.foxit.sdk.pdf.PDFPage.setThumbnail ( Bitmap  thumbnail) throws com.foxit.sdk.PDFException

设置页面缩略图。

缩略图位图不使用alpha通道。因此建议用户设置 没有alpha通道的位图作为新缩略图。如果设置了带有alpha通道的位图, 新缩略图默认将使用白色背景。 目前,此函数不支持格式为 com.foxit.sdk.common.Bitmap.e_DIBRgb565 的位图。

参数
[in]thumbnail新的页面缩略图。它应该是有效的位图。
返回
无。

◆ setUserUnitSize()

void com.foxit.sdk.pdf.PDFPage.setUserUnitSize ( float  user_unit) throws com.foxit.sdk.PDFException

设置用户单位。

一个正数,给出默认用户空间单位的大小,以1/72英寸的倍数表示。 支持值的范围取决于实现。如果未设置, Foxit PDF SDK将使用默认值1.0(用户单位为1/72英寸)。

参数
[in]user_unit一个正数,给出默认用户空间单位的大小,以1/72英寸的倍数表示。
返回
无。

◆ splitTextsInRectangle()

TextObjectArray com.foxit.sdk.pdf.PDFPage.splitTextsInRectangle ( RectF  rect,
int  split_step 
) throws com.foxit.sdk.PDFException

分割文本对象,这些对象的矩形(在中)与指定的矩形 (在中)相交,并根据split_step进一步分割相交部分。

此函数根据split_step分割与指定矩形相交的文本对象。 当文本对象与指定矩形相交时,相交部分将根据split_step被分为一个或多个 文本对象。同样,对于只部分与指定矩形相交的文本对象, 它们的非相交部分将被分离出来并作为单独的文本对象处理。如果split_step大于0, 与指定矩形相交的文本对象部分将被分割为几个文本对象。具体来说,每个新的 文本对象将对应指定矩形中的一个段,每个段中的单词数由 split_step定义。如果相交部分中剩余的单词数少于split_step,那些剩余的 单词将被组合成一个文本对象。如果 split_step 为 0,则与指定矩形相交的文本对象的 相交部分将不再进一步分割,将被组合成一个文本对象。

参数
[in]rect指定的矩形,位于 中。
[in]split_step用于分割与指定矩形相交的文本对象的单词数。 此值不能为负数。值为 0 表示与指定矩形相交的文本对象将不再 进一步分割,将被组合成一个文本对象。
返回
分割后与指定矩形相交的文本图形对象数组。
注解
矩形(在 中)与指定矩形(在 中)相交的文本对象将分别分割,不会合并在一起。 如果文本对象的矩形(在 中)与指定矩形相交 (在 PDF坐标系中),但其所有字符都位于指定矩形(在 中)外, 则这些文本对象不会被视为指定矩形(在 中)内的分割文本对象。

◆ startParse()

Progressive com.foxit.sdk.pdf.PDFPage.startParse ( int  flags,
PauseCallback  pause,
boolean  is_reparse 
) throws com.foxit.sdk.PDFException

开始解析当前页面。

解析PDF页面可能需要很长时间,因此Foxit PDF SDK使用渐进式过程来执行此操作。 页面内容的所有资源将在PDF页面解析后加载。
用户可以在不解析页面的情况下获取页面或注释的字典,但要执行 与页面内容相关的操作,请首先解析页面。

参数
[in]flags解析标志。请参考从com.foxit.sdk.pdf.PDFPage.e_ParsePageNormal 开始的值, 这应该是这些值中的一个或这些值的组合。 默认值:com.foxit.sdk.pdf.PDFPage.e_ParsePageNormal
[in]pause暂停回调对象,决定解析过程是否需要暂停。 这可以是null,表示在解析过程中不暂停。 如果这不是null,它应该是用户实现的有效暂停对象。 默认值:null
[in]is_reparsetrue表示重新解析当前页面,false表示不 重新解析当前页面。默认值:false
返回
渐进式对象。请通过函数common.Progressive.getRateOfProgress 检查当前进度的比率。 如果比率还不是100,调用函数common.Progressive.resume 继续进度直到进度完成。
注解
当参数is_reparse设置为true时,表示重新解析当前PDF页面, 所有检索到的图形对象位置(作为POSITION对象)和图形对象(作为 com.foxit.sdk.pdf.graphics.GraphicsObject 对象)将变为无效。
应用程序需要在重新解析PDF页面后重新获取图形对象。

◆ transform()

boolean com.foxit.sdk.pdf.PDFPage.transform ( Matrix2D  matrix,
boolean  need_transform_clip_path,
boolean  need_transform_annotations 
) throws com.foxit.sdk.PDFException

转换PDF页面,包括页面上的注释和表单字段。

注解
此函数仅支持缩放和平移。执行此操作后,请通过函数 PDFPage.startParse 重新解析当前页面,参数is_reparsetrue, 以便显示预期的内容。
参数
[in]matrix转换矩阵。
[in]need_transform_clip_pathtrue表示转换页面时包含剪切矩形, false表示不包含。
[in]need_transform_annotationstrue表示转换页面时包含注释, false表示不包含。
返回
true表示成功,false表示失败。

◆ updateAnnotList()

void com.foxit.sdk.pdf.PDFPage.updateAnnotList ( )

更新注释列表。

如果通过直接更改"Annots"字典项来修改(添加/删除...)任何注释, 请在更改后调用此函数来更新注释列表。

返回
无。

类成员变量说明

◆ e_ArtBox

final int com.foxit.sdk.pdf.PDFPage.e_ArtBox = 3
static

页面边界的艺术框。

修剪后成品页面的预期尺寸。

◆ e_BleedBox

final int com.foxit.sdk.pdf.PDFPage.e_BleedBox = 4
static

页面边界的出血框。

页面创建者意图的页面有意义内容(包括潜在空白)的范围。

◆ e_CropBox

final int com.foxit.sdk.pdf.PDFPage.e_CropBox = 1
static

页面边界的裁剪框。

在显示或打印时页面内容要被裁剪(剪切)的区域。

◆ e_MediaBox

final int com.foxit.sdk.pdf.PDFPage.e_MediaBox = 0
static

页面边界的媒体框。

页面要显示或打印的物理媒体的边界。

◆ e_TrimBox

final int com.foxit.sdk.pdf.PDFPage.e_TrimBox = 2
static

页面边界的修剪框。

在生产环境中输出时页面内容应该被裁剪的区域。