GDPicturePDF.LoadFromFile Fails on Newly Created PDF

Discussions about PDF management.
Post Reply
ifiling
Posts: 9
Joined: Fri Jun 10, 2011 4:34 pm

GDPicturePDF.LoadFromFile Fails on Newly Created PDF

Post by ifiling » Wed Jul 13, 2011 2:14 pm

I'm experiencing an issue running 8.0.3 whereby a PDF created from GDPicture.PdfOCRStart cannot then be opened by GDPicturePDF.LoadFromFile

Code: Select all

 Dim _FileName As String = IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), Now.ToString("yyyyMMMddhhmmss") & ".pdf")

      Dim imgID As Integer
      Dim PageText As String = ""

      Using x As New frmScan
        x.ShowDialog(Me)
        If Not x.Pages.Count = 0 Then
          Dim PdfID As Integer = oGDPicture.PdfOCRStart(_FileName, True, "file@home Document", Environment.UserName, "", "", "file@home")
          For i As Integer = 1 To x.Pages.Count
            imgID = CInt(x.Pages.Item(i))
            If Not imgID = 0 Then
              oGDPicture.PdfAddGdPictureImageToPdfOCR(PdfID, imgID, "eng", "C:\Program Files\GdPicture.NET 8\Redist\OCR", "")
              Call oGDPicture.ReleaseGdPictureImage(imgID)
            End If
          Next
          oGDPicture.PdfOCRStop(PdfID)
        End If
      End Using

      ShowOCRText(_FileName)
This sub then fails with PDFCanNotOpenFile

Code: Select all

Private Sub ShowOCRText(ByVal fName As String)
    Dim PageText As String = ""
    If oGDPicturePDF.LoadFromFile(fName, True) = GdPictureStatus.OK Then
      For i As Integer = 1 To oGDPicturePDF.GetPageCount
        oGDPicturePDF.SelectPage(i)
        PageText = PageText & " " & oGDPicturePDF.GetPageText
      Next
    Else
      MessageBox.Show(oGDPicturePDF.GetStat.ToString)
    End If
  End Sub
I'll upload this test ASAP

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: GDPicturePDF.LoadFromFile Fails on Newly Created PDF

Post by Loïc » Wed Jul 13, 2011 2:25 pm


ifiling
Posts: 9
Joined: Fri Jun 10, 2011 4:34 pm

Re: GDPicturePDF.LoadFromFile Fails on Newly Created PDF

Post by ifiling » Wed Jul 13, 2011 4:03 pm

I can. It's under ticket 12550

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: GDPicturePDF.LoadFromFile Fails on Newly Created PDF

Post by Loïc » Wed Jul 13, 2011 4:11 pm

Hi,

Working with GdPicture.NET 8.0.4.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests