以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]能否跳过继续  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=117904)

--  作者:天一生水
--  发布时间:2018/4/20 16:54:00
--  [求助]能否跳过继续

文字识别多张图片,遇到不能识别的就卡住不往下进行了,怎样跳过当前图片,继续下一张图片识别?


Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")          ‘列表视图中的文件名
For Each vr As WinForm.ListViewRow In lvw.Rows
    If vr Is Nothing Then \'如果不存在当前行
        Return
    Else
        Dim doc = CreateObject("MODI.Document")
        doc.Create(ProjectPath & "Attachments\\" & vr.ImageKey)              ’加入图片地址
        doc.OCR(2052, True, True)
        For ii As Integer = 0 To doc.Images.count - 1
            Dim layout = doc.images(ii).Layout
            Dim s As String = layout.text
            Dim rt = e.Form.Controls("Panelx").BaseControl.Controls("richTextBox1")      \'将内容写入文本框
            rt.text = " " & rt.text & s & vbcrlf & vbcrlf  &  "    
        Next
        doc.close
        doc = Nothing
    End If
Next


--  作者:有点甜
--  发布时间:2018/4/20 17:09:00
--  

识别pdf文字,请参考

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=76704&skin=0

 

 


--  作者:有点甜
--  发布时间:2018/4/20 17:09:00
--  

往下执行,试试 加入代码

 

On error resume next