图像处理工具包ImagXpress插入多页教程指南

该InsertPage方法插入来自一个源的TIFF文件的单个页面到另一个目的地的TIFF文件。该InsertPage 方法允许源多页的TIFF文件或单页的TIFF文件的第一页被插入到一个目的地TIFF文件。 点击下载

该InsertPages方法支持在源多页的TIFF文件设置起始页面和设定的页面的数量,以从源TIFF文件到目标TIFF文件被插入。

该InsertPage 方法如下所示:

VB范例

Sub InsertPage( sourceFile As String, destFile As String, PageNbr As Long )
该InsertPages 方法如下所示:
VB范例

Sub InsertPages( sourceFile As String, sourcePageNbr As Long,
NumPages As Long, destFile As String, destPageNbr As Long )
将一个TIFF文档的第一页插入另一个
使用InsertPage 将多页TIFF文档的前3页插入到另一个文档中需要类似于以下代码:

Dim i As Integer
FileCopy sourceFile, tempSourceFile
For i = 1 To 3
ImagXpress1.InsertPage tempSourceFile, destFile, i
ImagXpress1.DeletePage tempSourceFile, 1
Next
可以使用 带有以下代码的InsertPages完成相同的任务:
ImagXpress1.InsertPages sourceFile,1、3,destFile,1
将一个TIFF文档的页面追加到另一个
使用InsertPage 方法将一个TIFF文档的前3页追加到另一个TIFF文档的末尾,所需的代码类似于以下内容:

Dim numberOfPagesInDocument As Long
Dim startPageToAppend As Long
Dim i As Integer
numberOfPagesInDocument = ImagXpress1.NumPages(filename)
startPageToAppend = numberOfPagesInDocument
FileCopy sourceFile, tempSourceFile
For i = 1 To 3
ImagXpress1.InsertPage tempSourceFile, destFile, startPageToAppend + i
ImagXpress1.DeletePage tempSourceFile, 1
Next
使用InsertPages 和以下代码可以完成相同的任务:
ImagXpress1.InsertPages sourceFile,1、3,destFile,MaxLongConst
在上面创建一个常量为2,147,483,647的MaxLongConst时,会向InsertPages 方法发出信号,以便将页面追加到文档的末尾。设置大于目标文件页数的任何值会将其附加到文件末尾。

本文章转载自【慧都科技】evget欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,尊重他人劳动成果
原文链接:https://www.evget.com/article/2021/1/6/40006.html

猜你喜欢

转载自blog.csdn.net/RoffeyYang/article/details/112267331
今日推荐