PdfPageEditor

遗产: java.lang.Object, com.aspose.pdf.facades.IVentureLicenseTarget, com.aspose.pdf.facades.Facade, com.aspose.pdf.facades.SaveableFacade

public final class PdfPageEditor extends SaveableFacade

表示一个类来编辑PDF文件的页面,包括旋转页面、缩放页面、移动位置和改变页面大小。

构造函数

构造函数描述
PdfPageEditor()PdfPageEditor 类的构造函数。
PdfPageEditor(Document document)PdfPageEditor 类的构造函数。

领域

场地描述
BLINDH垂直百叶窗
BLINDV垂直百叶窗
BTWIPE自下而上擦除
DGLITTER对角闪光
DISSOLVE旧页面溶解
INBOX内盒
LRGLITTER左右闪光
LRWIPE左右擦除
OUTBOX外箱
RLWIPE左右擦除
SPLITHININ水平分割
SPLITHOUT出水平分割
SPLITVIN在垂直分割
SPLITVOUT出垂直分割
TBGLITTER上下闪光
TBWIPE上下擦拭

方法

方法描述
applyChanges()应用对文档页面所做的更改。
bindPdf(IDocument srcDoc)初始化门面。
bindPdf(InputStream srcStream)初始化门面。
bindPdf(InputStream srcStream, String password)初始化门面。
bindPdf(String srcFile)初始化门面。
bindPdf(String srcFile, String password)初始化门面。
close()处理与外观绑定的文档。
dispose()处理门面。
equals(Object arg0)
getAlignment()获取原始PDF内容在结果页面的水平对齐方式,默认为AlignmentType.Left。
getClass()
getDisplayDuration()获取页面的显示持续时间。
getDocument()获取正在处理的文档外观。
getHorizontalAlignment()获取原始PDF内容在结果页面的水平对齐方式,默认为AlignmentType.Left。
getPageBoxSize(int page, String pageBoxName)返回文档中指定框的大小。
getPageRotation(int page)返回指定页面的旋转。
getPageRotations()获取页面的旋转,一个哈希表包含页码和旋转度数,key代表页码,key的值代表旋转度数。
getPageSize()获取输出文件的页面大小。
getPageSize(int page)返回指定页面的页面大小。
getPages()返回总页数。
getProcessPages()获取要编辑的页码。
getRotation()获取页面的旋转角度,旋转角度必须为 0、90、180 或 270。
getTransitionDuration()获取过渡效果的持续时间。
getTransitionType()获取在演示过程中从另一个页面移至此页面时要使用的过渡样式。
getVerticalAlignment()获取原始PDF内容在结果页面的垂直对齐方式,默认为VerticalAlignmentType.Bottom。
getVerticalAlignmentType()获取原始PDF内容在结果页面的垂直对齐方式,默认为VerticalAlignmentType.Bottom。
getZoom()获取缩放系数。
hashCode()
movePosition(float moveX, float moveY)将原点从 (0, 0) 移动到指定的点。
notify()
notifyAll()
save(OutputStream outputStream)将更改的文档保存到流中。
save(String outputFile)将更改的文档保存到文件中。
setAlignment(AlignmentType value)设置原始 PDF 内容在结果页面上的水平对齐方式,默认为 AlignmentType.Left。
setDisplayDuration(int value)设置页面的显示持续时间。
setHorizontalAlignment(int value)设置原始 PDF 内容在结果页面上的水平对齐方式,默认为 AlignmentType.Left。
setPageRotations(Map<Integer,Integer> value)设置页面的旋转,一个哈希表包含页码和旋转度数,key代表页码,key的值代表旋转度数。
setPageSize(PageSize value)设置输出文件的页面大小。
setProcessPages(int[] value)设置要编辑的页码。
setRotation(int value)设置页面的旋转角度,旋转角度必须为 0、90、180 或 270。
setTransitionDuration(int value)设置过渡效果的持续时间。
setTransitionType(int value)设置在演示期间从另一个页面移动到此页面时要使用的过渡样式。
setVerticalAlignment(VerticalAlignmentType value)设置原始 PDF 内容在结果页面上的垂直对齐方式,默认为 VerticalAlignmentType.Bottom。
setVerticalAlignmentType(int value)设置原始 PDF 内容在结果页面上的垂直对齐方式,默认为 VerticalAlignmentType.Bottom。
setZoom(float value)设置缩放系数。
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PdfPageEditor()

public PdfPageEditor()

PdfPageEditor 类的构造函数。

PdfPageEditor(Document document)

public PdfPageEditor(Document document)

PdfPageEditor 类的构造函数。

参数:

范围类型描述
documentDocument应处理的文档对象。

BLINDH

public static final int BLINDH

垂直百叶窗

BLINDV

public static final int BLINDV

垂直百叶窗

BTWIPE

public static final int BTWIPE

自下而上擦除

DGLITTER

public static final int DGLITTER

对角闪光

DISSOLVE

public static final int DISSOLVE

旧页面溶解

INBOX

public static final int INBOX

内盒

LRGLITTER

public static final int LRGLITTER

左右闪光

LRWIPE

public static final int LRWIPE

左右擦除

OUTBOX

public static final int OUTBOX

外箱

RLWIPE

public static final int RLWIPE

左右擦除

SPLITHIN

public static final int SPLITHIN

IN水平分割

SPLITHOUT

public static final int SPLITHOUT

出水平分割

SPLITVIN

public static final int SPLITVIN

在垂直分割

SPLITVOUT

public static final int SPLITVOUT

出垂直分割

TBGLITTER

public static final int TBGLITTER

上下闪光

TBWIPE

public static final int TBWIPE

上下擦拭

applyChanges()

public void applyChanges()

应用对文档页面所做的更改。

bindPdf(IDocument srcDoc)

public void bindPdf(IDocument srcDoc)

初始化门面。

参数:

范围类型描述
srcDocIDocument文档对象。

bindPdf(InputStream srcStream)

public void bindPdf(InputStream srcStream)

初始化门面。

参数:

范围类型描述
srcStreamjava.io.InputStreamPDF文件流。

bindPdf(InputStream srcStream, String password)

public void bindPdf(InputStream srcStream, String password)

初始化门面。

参数:

范围类型描述
srcStreamjava.io.InputStreamPDF文件流。
passwordjava.lang.StringPDF文档的密码。

bindPdf(String srcFile)

public void bindPdf(String srcFile)

初始化门面。

参数:

范围类型描述
srcFilejava.lang.StringPDF文件。

bindPdf(String srcFile, String password)

public void bindPdf(String srcFile, String password)

初始化门面。

参数:

范围类型描述
srcFilejava.lang.StringPDF文件
passwordjava.lang.StringPDF文档的密码。

close()

public void close()

处理与外观绑定的文档。

dispose()

public void dispose()

处理门面。

此方法已过时,请改用 close() 。

equals(Object arg0)

public boolean equals(Object arg0)

参数:

范围类型描述
arg0java.lang.Object

退货: 布尔值

getAlignment()

public AlignmentType getAlignment()

获取原始PDF内容在结果页面的水平对齐方式,默认为AlignmentType.Left。 改为使用 getHorizontalAlignment

退货: AlignmentType - AlignmentType 对象

getClass()

public final native Class<?> getClass()

退货: java.lang.Class

getDisplayDuration()

public int getDisplayDuration()

获取页面的显示持续时间。

退货: int - 整数值

getDocument()

public IDocument getDocument()

获取正在处理的文档外观。

退货: IDocument IDocument 元素

getHorizontalAlignment()

public int getHorizontalAlignment()

获取原始PDF内容在结果页面的水平对齐方式,默认为AlignmentType.Left。

退货: int - HorizontalAlignment 元素

getPageBoxSize(int page, String pageBoxName)

public Rectangle getPageBoxSize(int page, String pageBoxName)

返回文档中指定框的大小。


The following example demonstrates how to get media box of the 1st page:


 PdfPageEditor editor = new PdfPageEditor();
 editor.bindPdf("sample.pdf");
 Rectangle rect = editor.getBoxSize(1, "media");

参数:

范围类型描述
pageint页面索引。文档页面从 1 开始编号。
pageBoxNamejava.lang.String框类型名称。有效值为:“art”、“bleed”、“crop”、“media”、“trim”。

退货: Rectangle - 包含请求框的矩形。

getPageRotation(int page)

public int getPageRotation(int page)

返回指定页面的旋转。


The following example demonstrates how to get page rotation:


 PdfPageEditor editor = new PdfPageEditor();
 editor.bindPdf("sample.pdf");
 int rotation = editor.getPageSize(1);
 System.out.println("Rotation of 1st page : " + rotation + " degrees");

参数:

范围类型描述
pageint页面索引。文档页面从 1 开始编号。

退货: int - 页面旋转度数。

getPageRotations()

public Map<Integer,Integer> getPageRotations()

获取页面的旋转,一个哈希表包含页码和旋转度数,key代表页码,key的值代表旋转度数。

退货: java.util.Map<java.lang.Integer,java.lang.Integer> - 地图对象

getPageSize()

public PageSize getPageSize()

获取输出文件的页面大小。

退货: PageSize - PageSize 对象

getPageSize(int page)

public PageSize getPageSize(int page)

返回指定页面的页面大小。


The following example demonstrates using of GetPageSize method:


 PdfPageEditor editor = new PdfPageEditor();
 editor.bindPdf("sample.pdf");
 PageSize size = editor.getPageSize(1);
 System.out.println("Size of 1st page : " + size.getWidth() + " x " + size.getHeight());

参数:

范围类型描述
pageint页面索引。文档页面从 1 开始编号。

退货: PageSize 结果是 PageSize 的实例。使用返回对象的宽度和高度属性获取页面宽度和高度。

getPages()

public int getPages()

返回总页数。


The following example demonstrates using of GetPages() method:


 PdfPageEditor editor = new PdfPageEditor();
 editor.bindPdf("sample.pdf");
 System.out.println("Document has: " + editor.GetPages());

退货: int - 页数。

getProcessPages()

public int[] getProcessPages()

获取要编辑的页码。默认情况下,每个页面都会被编辑。

退货: 整数[] - 整数值数组

getRotation()

public int getRotation()

获取页面的旋转角度,旋转角度必须为 0、90、180 或 270。默认值为 0。

退货: int - 整数值

getTransitionDuration()

public int getTransitionDuration()

获取过渡效果的持续时间。

退货: int - 整数值

getTransitionType()

public int getTransitionType()

获取在演示过程中从另一个页面移至此页面时要使用的过渡样式。

退货: int - 整数值

getVerticalAlignment()

public VerticalAlignmentType getVerticalAlignment()

获取原始PDF内容在结果页面的垂直对齐方式,默认为VerticalAlignmentType.Bottom。 改为使用 getVerticalAlignmentType

退货: VerticalAlignmentType - VerticalAlignmentType 对象

getVerticalAlignmentType()

public int getVerticalAlignmentType()

获取原始PDF内容在结果页面的垂直对齐方式,默认为VerticalAlignmentType.Bottom。

退货: int - VerticalAlignmentType 元素

getZoom()

public float getZoom()

获取缩放系数。值 1.0 对应于 100%。默认值为 1.0。

退货: float - 浮点值

hashCode()

public native int hashCode()

退货: 整数

movePosition(float moveX, float moveY)

public void movePosition(float moveX, float moveY)

将原点从 (0, 0) 移动到指定的点。原点在左下角,单位为点(1 英寸 = 72 点)。


PdfPageEditor editor = new PdfPageEditor();
 editor.bindPdf("input.pdf");
 editor.movePosition(-100, 60);
 editor.save("moved.pdf");

参数:

范围类型描述
moveXfloatX 坐标。
moveYfloatY 坐标。

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

save(OutputStream outputStream)

public void save(OutputStream outputStream)

将更改的文档保存到流中。


The following sample demonstrates how to save changed PDF document into stream.


 PdfPageEditor editor = new PdfPageEditor();
 editor.bindPdf("sample.pdf");
 editor.setZoom ( 0.5f);
 editor.save("newdocument.pdf");

参数:

范围类型描述
outputStreamjava.io.OutputStream将保存更改的 PDF 文档的流。

save(String outputFile)

public void save(String outputFile)

将更改的文档保存到文件中。


The following sample demonstrates how to save changed PDF document


 PdfPageEditor editor = new PdfPageEditor();
 editor.bindPdf("sample.pdf");
 editor.setZoom ( 0.5f);
 editor.save("newdocument.pdf");

参数:

范围类型描述
outputFilejava.lang.String保存文档的文件路径。

setAlignment(AlignmentType value)

public void setAlignment(AlignmentType value)

设置原始 PDF 内容在结果页面上的水平对齐方式,默认为 AlignmentType.Left。 改为使用 setHorizontalAlignment

参数:

范围类型描述
valueAlignmentTypeAlignmentType 值

setDisplayDuration(int value)

public void setDisplayDuration(int value)

设置页面的显示持续时间。

参数:

范围类型描述
valueint整数值

setHorizontalAlignment(int value)

public void setHorizontalAlignment(int value)

设置原始 PDF 内容在结果页面上的水平对齐方式,默认为 AlignmentType.Left。

参数:

范围类型描述
valueint整数值

setPageRotations(Map<Integer,Integer> value)

public void setPageRotations(Map<Integer,Integer> value)

设置页面的旋转,一个哈希表包含页码和旋转度数,key代表页码,key的值代表旋转度数。

参数:

范围类型描述
valuejava.util.Map<java.lang.Integer,java.lang.Integer>地图对象

setPageSize(PageSize value)

public void setPageSize(PageSize value)

设置输出文件的页面大小。

参数:

范围类型描述
valuePageSizePageSize 对象

setProcessPages(int[] value)

public void setProcessPages(int[] value)

设置要编辑的页码。默认情况下,每个页面都会被编辑。

参数:

范围类型描述
valueint[]整数值数组

setRotation(int value)

public void setRotation(int value)

设置页面的旋转角度,旋转角度必须为 0、90、180 或 270。默认值为 0。

参数:

范围类型描述
valueint整数值

setTransitionDuration(int value)

public void setTransitionDuration(int value)

设置过渡效果的持续时间。

参数:

范围类型描述
valueint整数值

setTransitionType(int value)

public void setTransitionType(int value)

设置在演示期间从另一个页面移动到此页面时要使用的过渡样式。

参数:

范围类型描述
valueint整数值

setVerticalAlignment(VerticalAlignmentType value)

public void setVerticalAlignment(VerticalAlignmentType value)

设置原始 PDF 内容在结果页面上的垂直对齐方式,默认为 VerticalAlignmentType.Bottom。 改为使用 setVerticalAlignmentType

参数:

范围类型描述
valueVerticalAlignmentTypeVerticalAlignmentType 值

setVerticalAlignmentType(int value)

public void setVerticalAlignmentType(int value)

设置原始 PDF 内容在结果页面上的垂直对齐方式,默认为 VerticalAlignmentType.Bottom。

参数:

范围类型描述
valueintVerticalAlignment 元素

setZoom(float value)

public void setZoom(float value)

设置缩放系数。值 1.0 对应于 100%。默认值为 1.0。

参数:

范围类型描述
valuefloat浮点值

The following example demonstrates how to change zoom of the document pages.


                 PdfPageEditor editor = new PdfPageEditor();
                 editor.bindPdf("sample.pdf");
                 editor.setZoom ( 0.5f);
``` |

### toString() {#toString--}

公共字符串 toString()





**Returns:**
java.lang.String
### wait() {#wait--}

公共最终无效等待()





### wait(long arg0) {#wait-long-}

public final native void wait(long arg0)





**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| arg0 | long |  |

### wait(long arg0, int arg1) {#wait-long-int-}

公共最终无效等待(长 arg0,int arg1)





**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| arg0 | long |  |
| arg1 | int |  |