利用GdPicture.NET实现多页TIFF文件的页面的添加_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > 利用GdPicture.NET实现多页TIFF文件的页面的添加

利用GdPicture.NET实现多页TIFF文件的页面的添加

 2016/5/12 5:37:08  helloworld..  程序员俱乐部  我要评论(0)
  • 摘要:GdPicture.NET是一款功能全面且可无限分发的文档图像处理的一体化工具包。其一体化主要包含:PDF、图像处理、文档影像、扫描、条形码、打印、OCR、表单处理、注释等。本文将简单介绍在GdPicture.NET中多页TIFF文件的页面的添加。这里讲提供三种方法,给出了代码可供参考:1、末尾的添加DimoGdPictureImagingAsNewGdPictureImagingDimImageIDAsInteger=oGdPictureImaging
  • 标签:.net 实现 文件 net 利用

GdPicture.NET是一款功能全面且可无限分发的文档图像处理的一体化工具包。其一体化主要包含:PDF、图像处理、文档影像、扫描、条形码、打印、OCR、表单处理、注释等。本文将简单介绍在GdPicture.NET中多页TIFF文件的页面的添加。

这里讲提供三种方法,给出了代码可供参考:

1、末尾的添加

class="brush:csharp;">Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
oGdPictureImaging.TiffAppendPageFromFile(ImageID, "addition.tif")
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)

oGdPictureImaging.ReleaseGdPictureImage(ImageID)

可用上面相同的方法添加一个页面保存为GdPictureImage

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
Dim AddImgID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("addition.tif")
oGdPictureImaging.TiffAppendPageFromGdPictureImage(ImageID, AddImgID)
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(AddImgID)

2、通过创建TiffSaveAsMultiPageFile()方法将页面到文件末尾

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID, TiffID As Integer
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("image1.tif")
oGdPictureImaging.TiffSaveAsMultiPageFile(ImageID, "multipage.tif", TiffCompression.TiffCompressionAUTO)
'At this step ImageID1 handles a reference to the multipage tiff stream.
TiffID = ImageID
'adding a second page in the multipage stream from image2.tif
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("image2.tif")
oGdPictureImaging.TiffAddToMultiPageFile(TiffID, ImageID)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.TiffCloseMultiPageFile(TiffID) 'end the file
oGdPictureImaging.ReleaseGdPictureImage(TiffID) 'releasing the input bitmap from the memory

3、任意位置的添加

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
oGdPictureImaging.TiffInsertPageFromFile(ImageID, 3, "addition.tif")
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer
Dim AddImgID As Integer
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
AddImgID = oGdPictureImaging.CreateGdPictureImageFromFile("addition.tif")
oGdPictureImaging.TiffInsertPageFromGdPictureImage(ImageID, 3, AddImgID)
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(AddImgID)

我可以看到其基本方法:Add—Save—Released

点击查看产品详情

发表评论
用户名: 匿名