彩票走势图

GdPicture.NET文件转换教程连载:将TIFF转换成PDF OCR

原创|其它|编辑:郝浩|2012-12-25 13:55:52.000|阅读 303 次

概述:下面是在GdPicture.NET的"high performance"模式中将多页TIFF文件转换成OCR多页PDF文件的代码示例

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

相关链接:

下面是在GdPicture.NET的"high performance"模式中将多页TIFF文件转换成OCR多页PDF文件的代码示例:

》》》下载GdPicture.NET最新试用版

代码示例:

    Private Function TiffToPDFOCR(ByVal TiffIn As String, ByVal PdfOut As String) As GdPictureStatus
        Dim Status As GdPictureStatus = GdPictureStatus.OK
        Dim oGdPictureImaging As New GdPicture.GdPictureImaging
        Dim TiffID As Integer
        Dim PdfID As Integer
        Dim PageCount As Integer

        oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a valid license KEY

        PdfID = oGdPictureImaging.PdfNewPdf(PdfOut)

        If PdfID <> 0 Then
            oGdPictureImaging.TiffOpenMultiPageForWrite(False) 'We want to open multipage tiff for read only to get best performences
            TiffID = oGdPictureImaging.CreateGdPictureImageFromFile(TiffIn)
            If TiffID <> 0 Then
                PageCount = oGdPictureImaging.TiffGetPageCount(TiffID)

                PdfID = oGdPictureImaging.PdfOCRStart(PdfOut, True, "PDF Title", "PDF Author", "PDF Subject", "PDF keywords", "PDF Creator")

                For i As Integer = 1 To PageCount
                    oGdPictureImaging.TiffSelectPage(TiffID, i)
                    oGdPictureImaging.PdfAddGdPictureImageToPdfOCR(PdfID, TiffID, TesseractDictionary.TesseractDictionaryEnglish, "c:\dictionarypath", "")
                Next
                oGdPictureImaging.PdfOCRStop(PdfID)
                oGdPictureImaging.ReleaseGdPictureImage(TiffID)
            Else
                Status = oGdPictureImaging.GetStat
            End If
        Else
            Status = oGdPictureImaging.GetStat
        End If

        Return Status
    End Function

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@cahobeh.cn

文章转载自:慧都控件网

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP