Page
遗产: java.lang.Object
所有已实现的接口: com.aspose.ms.System.IDisposable、java.io.Closeable、com.aspose.pdf.ISupportsMemoryCleanup
public final class Page implements System.IDisposable, Closeable, ISupportsMemoryCleanup
表示 PDF 文档页面的类。
方法
accept(AnnotationSelector visitor)
public void accept(AnnotationSelector visitor)
接受 AnnotationSelector 访问者对象,该对象提供使用注释的功能。
参数:
范围 | 类型 | 描述 |
---|---|---|
visitor | AnnotationSelector | 注释选择器对象。 |
accept(ImagePlacementAbsorber visitor)
public void accept(ImagePlacementAbsorber visitor)
接受 ImagePlacementAbsorber 访问者对象,该访问者对象提供处理图像放置对象的功能。
参数:
范围 | 类型 | 描述 |
---|---|---|
visitor | ImagePlacementAbsorber | 图像放置吸收器对象。 |
accept(TextAbsorber visitor)
public void accept(TextAbsorber visitor)
接受提供处理文本对象功能的 TextAbsorber 访问者对象。
参数:
范围 | 类型 | 描述 |
---|---|---|
visitor | TextAbsorber | 文本吸收器对象。 |
accept(TextFragmentAbsorber visitor)
public void accept(TextFragmentAbsorber visitor)
接受提供处理文本对象功能的 TextFragmentAbsorber 访问者对象。
参数:
范围 | 类型 | 描述 |
---|---|---|
visitor | TextFragmentAbsorber | 文本吸收器对象。 |
addImage(InputStream imageStream, Rectangle imageRect)
public void addImage(InputStream imageStream, Rectangle imageRect)
将图片添加到页面上,并将其定位在指定矩形保存图片比例的中间。
参数:
范围 | 类型 | 描述 |
---|---|---|
imageStream | java.io.InputStream | 图像流。 |
imageRect | Rectangle | 图片的位置。 |
addImage(InputStream stream, Rectangle rectangle, CompositingParameters compositingParameters)
public void addImage(InputStream stream, Rectangle rectangle, CompositingParameters compositingParameters)
将图片添加到页面上,并将其定位在指定矩形保存图片比例的中间。
参数:
范围 | 类型 | 描述 |
---|---|---|
stream | java.io.InputStream | 图像流。 |
rectangle | Rectangle | 图片的位置。 |
compositingParameters | CompositingParameters | 合成参数。 |
addImage(InputStream imageStream, Rectangle imageRect, int imageWidth, int imageHeight, boolean saveImageProportions)
public void addImage(InputStream imageStream, Rectangle imageRect, int imageWidth, int imageHeight, boolean saveImageProportions)
将可搜索图像添加到页面上,并将其定位在指定矩形保存图像比例的中间。
参数:
范围 | 类型 | 描述 |
---|---|---|
imageStream | java.io.InputStream | 输入流对象 |
imageRect | Rectangle | 矩形对象 |
imageWidth | int | 整数值 |
imageHeight | int | 整数值 |
saveImageProportions | boolean | 布尔值 |
addImage(String imagePath, Rectangle rectangle)
public void addImage(String imagePath, Rectangle rectangle)
将图片添加到页面上,并将其定位在指定矩形保存图片比例的中间。
参数:
范围 | 类型 | 描述 |
---|---|---|
imagePath | java.lang.String | 图像的路径。 |
rectangle | Rectangle | 图片的位置。 |
addImage(String hocr, InputStream imageStream, Rectangle imageRect)
public void addImage(String hocr, InputStream imageStream, Rectangle imageRect)
将可搜索图像添加到页面上,并将其定位在指定矩形保存图像比例的中间。
参数:
范围 | 类型 | 描述 |
---|---|---|
hocr | java.lang.String | 图像的原形。 |
imageStream | java.io.InputStream | 图像流。 |
imageRect | Rectangle | 图片的位置。 |
addStamp(Stamp stamp)
public void addStamp(Stamp stamp)
将邮票放入页面。戳记可以是页码、图像或简单的文本,例如一些标志。
参数:
范围 | 类型 | 描述 |
---|---|---|
stamp | Stamp | 添加到页面上的戳记。每个图章都有其坐标和与图章类型相关的相应属性,即图像或文本值。 |
asByteArray(Resolution resolution)
public byte[] asByteArray(Resolution resolution)
将当前页面转换为 BMP 位图,然后返回字节数组。
参数:
范围 | 类型 | 描述 |
---|---|---|
resolution | Resolution | 决议。 |
退货: 字节[] - 转换后的图像字节数组。
asXml()
public String asXml()
将当前页面转换为 utf8 编码的 xml。
退货: java.lang.String - 转换后的 xml 字符串。
calculateContentBBox()
public Rectangle calculateContentBBox()
计算 bbox 值 - 包含没有可见边距的内容的矩形。
退货: Rectangle - Bbox 值 - 包含没有可见边距的内容的矩形
clearContents()
public void clearContents()
仅供内部使用
close()
public void close()
关闭此文档使用的所有资源。
convertToPNGMemoryStream()
public byte[] convertToPNGMemoryStream()
为 DSR、OMR、OCR 图像流将页面转换为 PNG。
退货: 字节[- 以字节为单位的图像流[大批。
deleteUnusedResources(System.Collections.Generic.Dictionary<Integer,Integer> usageTable)
public void deleteUnusedResources(System.Collections.Generic.Dictionary<Integer,Integer> usageTable)
参数:
范围 | 类型 | 描述 |
---|---|---|
usageTable | com.aspose.ms.System.Collections.Generic.Dictionary<java.lang.Integer,java.lang.Integer> |
dispose()
public void dispose()
释放内存
此方法已过时,请改用 close() 。
equals(Object arg0)
public boolean equals(Object arg0)
参数:
范围 | 类型 | 描述 |
---|---|---|
arg0 | java.lang.Object |
退货: 布尔值
fillUsedObjectsTable(System.Collections.Generic.Dictionary<Integer,Integer> usageTable, IPdfDictionary CommonResources)
public void fillUsedObjectsTable(System.Collections.Generic.Dictionary<Integer,Integer> usageTable, IPdfDictionary CommonResources)
参数:
范围 | 类型 | 描述 |
---|---|---|
usageTable | com.aspose.ms.System.Collections.Generic.Dictionary<java.lang.Integer,java.lang.Integer> | |
CommonResources | IPdfDictionary |
findReferences(OperatorCollection contents, String name)
public static List<Object> findReferences(OperatorCollection contents, String name)
返回使用具有指定名称的资源的运算符列表。
参数:
范围 | 类型 | 描述 |
---|---|---|
contents | OperatorCollection | OperatorCollection 值 |
name | java.lang.String | 字符串值 |
退货: java.util.List<java.lang.Object> - 对象列表
findReferences(String name)
public List<Object> findReferences(String name)
查找参考资料
参数:
范围 | 类型 | 描述 |
---|---|---|
name | java.lang.String | 字符串值 |
退货: java.util.List<java.lang.Object> - 列表对象
flatten()
public void flatten()
删除位于页面上的所有静态字段并改为放置它们的值。
freeMemory()
public void freeMemory()
清除缓存数据
getActions()
public PageActionCollection getActions()
获取页面属性的集合。
退货: PageActionCollection PageActionCollection 值
getAnnotations()
public AnnotationCollection getAnnotations()
获取页面注释的集合。注释
退货: AnnotationCollection AnnotationCollection 值
getArtBox()
public Rectangle getArtBox()
获取页面的艺术框。
退货: Rectangle 矩形值
Example demonstrates how to get art box of the page:
Document document = new Document("sample.pdf");
Rectangle artBox = document.getPages().get(1).getArtBox();
getArtifacts()
public ArtifactCollection getArtifacts()
获取页面上的工件集合。
退货: ArtifactCollection ArtifactCollection 值
getBackground()
public Color getBackground()
获取页面的背景颜色。
退货: Color - 颜色值
getBackgroundImage()
public final Image getBackgroundImage()
获取或设置页面的背景图像(仅适用于生成器)。
退货: Image 图片实例
getBleedBox()
public Rectangle getBleedBox()
获取页面的出血框。
退货: Rectangle 矩形值
Example demonstrates how to get bleed box of the page:
Document document = new Document("sample.pdf");
Rectangle bleedBox = document.getPages().get(1).getBleedBox();
getClass()
public final native Class<?> getClass()
退货: java.lang.Class
getColorType()
public int getColorType()
根据从运算符 SetColor、图像和表单中获取的信息获取页面的颜色类型。
退货: int - ColorType 元素
getContents()
public OperatorCollection getContents()
获取页面内容流中的运算符集合。运算符集合
退货: OperatorCollection OperatorCollection 对象
Example is demonstrates how to scan operators stream of page.
Document document = new Document("sample.pdf");
Operators contents = document.getPages().get_Item(1).getContents();
for(Operator op : ```
(Iterable)
```contents)
{
System.out.println(op);
}
getContentsAppender()
public ContentsAppender getContentsAppender()
获取当前内容附加器。 ContentsAppender
退货: ContentsAppender - ContentsAppender 值
getCropBox()
public Rectangle getCropBox()
获取页面的裁剪框。
退货: Rectangle 矩形值
Example demonstrates how to get crop box of the page:
Document document = new Document("sample.pdf");
Rectangle cropBox = document.getPages().get_Item(1).getCropBox();
getDocument()
public IDocument getDocument()
获取文档
退货: IDocument IDocument 对象
getDuration()
public double getDuration()
获取页面显示时长。这是页面在演示过程中应显示的时间(以秒为单位)。如果未定义持续时间,则返回 -1。
示例演示如何获取页面持续时间
文档 document = new Document(“sample.pdf”);页面 page = document.getPages().get(1); int pageRect = page.getDuration();
退货: 双倍价值
getEnginePage()
public IPage getEnginePage()
仅供内部使用
退货: IPage - 内部实例
getFieldsInTabOrder()
public List<Field> getFieldsInTabOrder()
获取此页面上 Tab 顺序的 Field 对象列表。
退货: java.util.List<com.aspose.pdf.Field> - 字段对象列表
getFooter()
public HeaderFooter getFooter()
获取页脚。
退货: HeaderFooter 页脚。
getGroup()
public Group getGroup()
获取一个组属性类,该类指定用于透明成像模型的页页组的属性。
退货: Group - 集团价值
getHeader()
public HeaderFooter getHeader()
获取页眉。
退货: HeaderFooter 页眉。
getLayers()
public List<Layer> getLayers()
获取图层集合。
退货: java.util.List<com.aspose.pdf.Layer> - 值:图层集合。
getMediaBox()
public Rectangle getMediaBox()
获取页面的媒体框。
退货: Rectangle 矩形值
Example demonstrates how to get media box of the page:
Document document = new Document("sample.pdf");
Rectangle mediaBox = document.getPages().get(1).getMediaBox();
getNoteLineStyle()
public GraphInfo getNoteLineStyle()
获取笔记的线条样式。(仅适用于生成器)
退货: GraphInfo - GraphInfo 值
getNotifications()
public String getNotifications()
返回有关页面内容内部操作的通知。 (目前仅支持文本添加场景下的段落事件通知。)
退货: java.lang.String - 表示有关页面内容内部操作的通知的字符串。
getNumber()
public final int getNumber()
获取页码。
退货: int - 整数值
getOnBeforePageGenerate()
public PdfEvent<Page.BeforePageGenerate> getOnBeforePageGenerate()
自定义页眉和页脚的事件。
退货: PdfEvent - PdfEvent 实例
getPageInfo()
public PageInfo getPageInfo()
获取页面信息。(仅供生成器使用,读取文件时不填写)。
退货: PageInfo - 页面信息。
getPageRect(boolean considerRotation)
public Rectangle getPageRect(boolean considerRotation)
根据其 CropBox 返回页面的矩形(如果 CropBox 为 null,则返回 MediaBox)。
参数:
范围 | 类型 | 描述 |
---|---|---|
considerRotation | boolean | 如果为真,则页面的旋转将被考虑在矩形计算中。 |
退货: Rectangle - 页面的矩形。
getParagraphs()
public Paragraphs getParagraphs()
获取段落。
退货: Paragraphs - 段落。
getRect()
public Rectangle getRect()
根据其 CropBox 和 MediaBox 返回页面的矩形;对于获取:如果指定则返回页面裁剪框,否则返回页面媒体框。对于设置:页面媒体框始终设置。
退货: Rectangle 矩形值
Example demonstrates how to get page rectangle:
Document document = new Document("sample.pdf");
Page page = document.getPages().get(1);
Rectangle pageRect = page.getRect();
getRect_Rename_Namesake()
public Rectangle getRect_Rename_Namesake()
根据其 CropBox 和 MediaBox 返回页面的矩形;
内部的
退货: Rectangle 矩形值
Example demonstrates how to get page rectangle:
Document document = new Document("sample.pdf");
Page page = document.getPages().get(1);
Rectangle pageRect = page.getRect();
getResources()
public Resources getResources()
获取页面资源。资源对象包含图像、表单和字体的集合。资源
退货: Resources - 资源价值
Example demonstrates scan through page images:
Document document = new Document("sample.pdf");
DocumentActions actions = document.getActions();
Resources resources = document.getPages().get(1).getResources();
for(XImage image : ```
(Ierable)resources
```.getImages())
{
System.out.println(image.getWidth() + ":" + image.getHeight());
}
getRotate()
public int getRotate()
获取页面的旋转。
退货: int - 旋转元素
Example demonstrates how to determine page rotation.
Document document = new Document("sample.pdf");
System.out.println(document.getPages().get(1).getRotate());
getRotationMatrix()
public Matrix getRotationMatrix()
获取页面的变换矩阵。
退货: Matrix 矩阵值
getTabOrder()
public int getTabOrder()
获取页面的 Tab 键顺序。可能的值:行、列。默认、手动
退货: int - TabOrder 值
getTocInfo()
public TocInfo getTocInfo()
获取目录信息。
退货: TocInfo 目录信息 - 默认为空。如果它设置此页面将包含目录。
getTrimBox()
public Rectangle getTrimBox()
获取页面的裁切框。
退货: Rectangle 矩形值
Example demonstrates how to get trim box of the page:
Document document = new Document("sample.pdf");
Rectangle trimBox = document.getPages().get(1).getTrimBox();
getUserUnit()
public final double getUserUnit()
获取或设置 UserUnit 值。一个正数,给出默认用户空间单元的大小,是 1 的倍数\u0432\u0403\u201e 72 英寸。默认值为 1。请设置零或负值以清除页面中的此项。
退货: 双倍价值
getWatermark()
public Watermark getWatermark()
获取页面的水印。
退货: Watermark - 水印值
hashCode()
public native int hashCode()
退货: 整数
intToRotation(int rotation)
public static int intToRotation(int rotation)
将整数值转换为相应的旋转枚举成员。
参数:
范围 | 类型 | 描述 |
---|---|---|
rotation | int | 要转换的整数值 |
退货: int - 旋转枚举成员
isAddParagraphsAfterLast()
public final boolean isAddParagraphsAfterLast()
获取或设置页面最后一段后添加段落
Value:Value表示是否在页面最后一段之后添加段落。如果值为 true,将在页面的最后一段之后添加段落。
退货: boolean - 布尔值
isBlank(double fillThresholdFactor)
public boolean isBlank(double fillThresholdFactor)
获取页面是否为空白的标志。
参数:
范围 | 类型 | 描述 |
---|---|---|
fillThresholdFactor | double | 管理检测灵敏度的填充阈值。应等于或大于 0.01。 |
退货: boolean - 布尔值 True - 如果页面为空白;否则,假的。
makeGrayscale()
public final void makeGrayscale()
将页面转换为灰度。
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
removeObjectReferences(OperatorCollection contents, String name)
public static void removeObjectReferences(OperatorCollection contents, String name)
删除对象引用
参数:
范围 | 类型 | 描述 |
---|---|---|
contents | OperatorCollection | OperatorCollection 对象 |
name | java.lang.String | 价值 |
removeObjectReferences(String name)
public void removeObjectReferences(String name)
从页面内容中删除对 XObject 的引用(即所有使用对象名称的 Do 运算符)。
参数:
范围 | 类型 | 描述 |
---|---|---|
name | java.lang.String | 字符串值 |
rotationToInt(int rotation)
public static int rotationToInt(int rotation)
将旋转枚举成员转换为整数值。
参数:
范围 | 类型 | 描述 |
---|---|---|
rotation | int | 旋转枚举成员。 |
退货: int - 对应的整数值
sendTo(PageDevice device, OutputStream output)
public void sendTo(PageDevice device, OutputStream output)
发送页面以使用给定的页面设备进行处理。
参数:
范围 | 类型 | 描述 |
---|---|---|
device | PageDevice | 处理页面的设备。 |
output | java.io.OutputStream | 与设备一起使用以保存其输出的结果流。 |
sendTo(PageDevice device, String outputFileName)
public void sendTo(PageDevice device, String outputFileName)
发送页面以使用给定的页面设备进行处理。
参数:
范围 | 类型 | 描述 |
---|---|---|
device | PageDevice | 处理页面的设备。 |
outputFileName | java.lang.String | 与设备一起使用以保存其输出的文件。 |
setAddParagraphsAfterLast(boolean value)
public final void setAddParagraphsAfterLast(boolean value)
获取或设置页面最后一段后添加段落
Value:Value表示是否在页面最后一段之后添加段落。如果值为 true,将在页面的最后一段之后添加段落。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | boolean | 布尔值 |
setArtBox(Rectangle value)
public void setArtBox(Rectangle value)
设置页面的艺术框。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Rectangle | 矩形值 |
setBackground(Color value)
public void setBackground(Color value)
设置页面的背景颜色。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Color | 颜色对象 |
setBackground(Color value)
public void setBackground(Color value)
设置页面的背景颜色。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | java.awt.Color | 颜色对象 |
setBackgroundImage(Image value)
public final void setBackgroundImage(Image value)
获取或设置页面的背景图像(仅适用于生成器)。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Image | 图片实例 |
setBleedBox(Rectangle value)
public void setBleedBox(Rectangle value)
设置页面的出血框。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Rectangle | 矩形值 |
setCropBox(Rectangle value)
public void setCropBox(Rectangle value)
设置页面裁剪框。
Example demonstrates how to get crop box of the page:
Document document = new Document("sample.pdf");
document.getPages().get_Item(1).setCropBox(new Rectangle(0d,0d,100d,100d));
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Rectangle | 矩形对象 |
setDuration(double value)
public void setDuration(double value)
设置页面显示持续时间。这是页面在演示过程中应显示的时间(以秒为单位)。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | double | 页面显示时长。 |
setEnginePage(IPage enginePage)
public void setEnginePage(IPage enginePage)
仅供内部使用
参数:
范围 | 类型 | 描述 |
---|---|---|
enginePage | IPage | 内部实例 |
setFooter(HeaderFooter value)
public void setFooter(HeaderFooter value)
设置页脚。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | HeaderFooter | 页脚。 |
setGroup(Group value)
public void setGroup(Group value)
设置组属性类,指定用于透明成像模型的页面的页面组的属性。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Group | 集团价值 |
setHeader(HeaderFooter value)
public void setHeader(HeaderFooter value)
设置页眉。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | HeaderFooter | 页眉。 |
setLayers(ArrayList value)
public void setLayers(ArrayList<Layer> value)
设置图层集合。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | java.util.ArrayList<com.aspose.pdf.Layer> | :图层集合。 |
setLayersInternal(System.Collections.Generic.List value)
public void setLayersInternal(System.Collections.Generic.List<Layer> value)
设置图层集合。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | com.aspose.ms.System.Collections.Generic.List<com.aspose.pdf.Layer> | :图层集合。 |
setMediaBox(Rectangle value)
public void setMediaBox(Rectangle value)
设置页面的媒体框。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | 长方形 | Rectangle |
setNoteLineStyle(GraphInfo value)
public void setNoteLineStyle(GraphInfo value)
设置注释的线条样式。(仅适用于生成器)
参数:
范围 | 类型 | 描述 |
---|---|---|
value | GraphInfo | : GraphInfo 值 |
setPageInfo(PageInfo value)
public void setPageInfo(PageInfo value)
设置页面信息。(仅供生成器使用,读取文件时不填写)。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | PageInfo | 页面信息。 |
setPageSize(double width, double height)
public void setPageSize(double width, double height)
设置页面的页面大小。
参数:
范围 | 类型 | 描述 |
---|---|---|
width | double | 页面宽度。 |
height | double | 页面大小。 |
setParagraphs(Paragraphs value)
public void setParagraphs(Paragraphs value)
设置段落。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Paragraphs | 款值 |
setRect(Rectangle value)
public void setRect(Rectangle value)
获取或设置页面的矩形。对于获取:如果指定则返回页面裁剪框,否则返回页面媒体框。对于设置:页面媒体框始终设置。被退回。请注意,此属性不考虑页面旋转。要获得考虑旋转的页面矩形,请使用 ActualRect。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Rectangle | 矩形对象 |
setRotate(int value)
public void setRotate(int value)
设置页面的旋转。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | int | 旋转元素 |
setTabOrder(int value)
public void setTabOrder(int value)
设置页面的 Tab 键顺序。可能的值:行、列。默认、手动
参数:
范围 | 类型 | 描述 |
---|---|---|
value | int | TabOrder 对象 |
setTocInfo(TocInfo value)
public void setTocInfo(TocInfo value)
设置目录信息。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | TocInfo | 目录信息 - 默认为空。如果它设置此页面将包含目录。 |
setTransition(IPdfDictionary transition)
public void setTransition(IPdfDictionary transition)
设置过渡
参数:
范围 | 类型 | 描述 |
---|---|---|
transition | IPdfDictionary | IPDFDictionary 对象 |
setTrimBox(Rectangle value)
public void setTrimBox(Rectangle value)
设置页面的裁切框。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Rectangle | 矩形值 |
setUserUnit(double value)
public final void setUserUnit(double value)
获取或设置 UserUnit 值。一个正数,给出默认用户空间单元的大小,是 1 的倍数\u0432\u0403\u201e 72 英寸。默认值为 1。请设置零或负值以清除页面中的此项。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | double | 双倍价值 |
setWatermark(Watermark value)
public void setWatermark(Watermark value)
设置页面的水印。
参数:
范围 | 类型 | 描述 |
---|---|---|
value | Watermark | 水印对象 |
toString()
public String toString()
退货: java.lang.字符串
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
参数:
范围 | 类型 | 描述 |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
参数:
范围 | 类型 | 描述 |
---|---|---|
arg0 | long | |
arg1 | int |