- Code: Select all
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim oGdPictureImaging As New GdPictureImaging
Dim oGdPicturePDF As New GdPicturePDF
Dim RasterPageID As Integer
If oGdPicturePDF.LoadFromFile("c:\test.pdf", False) = GdPictureStatus.OK Then
oGdPicturePDF.SelectPage(1) 'Selecting first page
RasterPageID = oGdPicturePDF.RenderPageToGdPictureImage(200, True) '200 DPI rendering
oGdPicturePDF.CloseDocument()
oGdPictureImaging.SetROI(0, 0, 1000, 1000) ' here we make a region of interest from (0, 0) to (1000, 1000)
oGdPictureImaging.OCRTesseractSetOCRContext(OCRContext.OCRContextDocument) 'You can use another context if possible. This can increase accuracy
MsgBox(oGdPictureImaging.OCRTesseractDoOCR(RasterPageID, "eng", "C:\Program Files\GdPicture.NET 8\Redist\OCR", ""))
End If
'Clearing ressources
oGdPictureImaging.ReleaseGdPictureImage(RasterPageID)
oGdPictureImaging.Dispose()
End Sub
Feel free to post any comment, suggestion or support request in this thread.
