原創|其它|編輯:郝浩|2012-12-17 09:41:33.000|閱讀 595 次
概述:使用GdPicture.NET可對圖像掃描后進行簡單的處理,比如將PDF文件轉換成多頁的TIFF文件,本文將給出該示例的代碼。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
使用GdPicture.NET可對圖像掃描后進行簡單的處理,比如將PDF文件轉換成多頁的TIFF文件,本文將給出該示例的代碼。
示例代碼如下:
Dim oGdPictureImaging As New GdPictureImaging() Dim oGdPicturePDF As New GdPicturePDF If oGdPicturePDF.LoadFromFile("c:\test.pdf", False) = GdPictureStatus.OK Then Dim TiffID As Integer For i As Integer = 1 To oGdPicturePDF.GetPageCount() oGdPicturePDF.SelectPage(i) Dim RasterPageID As Integer = oGdPicturePDF.RenderPageToGdPictureImageEx(200, True) '200 DPI rendering with form fields, or native image extraction if the page is image based 'Convert rendered page to bitonal oGdPictureImaging.ConvertTo1Bpp(RasterPageID) 'Remove this line if you want to obtain colour tiff image If i = 1 Then TiffID = RasterPageID oGdPictureImaging.TiffSaveAsMultiPageFile(TiffID, "c:\multipage.tif", TiffCompression.TiffCompressionAUTO) Else oGdPictureImaging.TiffAddToMultiPageFile(TiffID, RasterPageID) End If oGdPictureImaging.ReleaseGdPictureImage(RasterPageID) Next oGdPictureImaging.TiffCloseMultiPageFile(TiffID) oGdPicturePDF.CloseDocument() MsgBox("Done!") Else MsgBox("can't open PDF") End If
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網