Loading...

cant handle more no. of pages while creating thumbnail

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

cant handle more no. of pages while creating thumbnail

Postby kviral » Tue Nov 10, 2009 6:05 pm

Hi Loic,

i am loading 257 pages PDF file into GD Viewer, at the same time after PDF gets loaded into viewer, i am making the thumbnail of all the pages laft side in listview control in vb6.
Now, reaching at 105th page, it stucks and givees error while generating thumbnail with error named "Invalid Picture".

My status would be as bellow.

GD Viewer Stat: GDViewer.getstat : 0
Imaging State: imaging1.getstat: 7

Please Advice,

My code is bellow,

Code: Select all
Private Sub LoadThumbnail(ThumbfileName As String)
On Error GoTo handleException
    Dim ThumbFileExtn As String
    Dim nCpt As Long
    Dim nThumbnailID As Long, nTifImageID As Long
    Dim tempImageKey As String
    Dim i As Integer
    Dim PDFThumbID As Long
   
    'Call BoundImageList
   
    'Sleep (5000)
    If (Trim(DuplicateThumbName) <> Trim(ThumbfileName)) Then
        DuplicateThumbName = ThumbfileName
        If (GdViewer1.PageCount >= 1) Then
            ListView1.ListItems.Clear
           
           
            GdViewer1.LockControl = True
            ThumbFileExtn = UCase(Mid(ThumbfileName, InStrRev(ThumbfileName, ".") + 1))
           
            ThumbfileName = UCase(Mid(ThumbfileName, InStrRev(ThumbfileName, "\") + 1))
            ThumbfileName = Mid(ThumbfileName, 1, Len(ThumbfileName) - 4)
                       
            Call LockComponents("Please wait, Creating Thumbnails") ' LOCKING COMPONENTS WHILE CREATING THUMBNAILS
           
                                   
            If (ThumbFileExtn = "PDF") Then
                For i = 1 To GdViewer1.PageCount
                    Imaging1.SetNativeImage (GdViewer1.GetNativeImage)
                    PDFThumbID = GdViewer1.GetNativeImage
                   
                    tempImageKey = "image" & Trim(i) * Rnd
                    Call ImageList1.ListImages.Add(, tempImageKey, Imaging1.GetPictureFromGdPictureImage(PDFThumbID))
                    'ListView1.ListItems.Add , tempImageKey, ThumbfileName & "Page " & " & Trim(i), tempImageKey, 1"
                    ListView1.ListItems.Add , tempImageKey, ThumbfileName & " Page " & i, tempImageKey, 1
                   
                    If (i < GdViewer1.PageCount) Then
                        'Imaging1.CloseImage (PDFThumbID)
                    End If
                    GdViewer1.DisplayNextFrame
                    StatusBar1.SimpleText = "Generating Thumbnail, have Patience, Page " & GdViewer1.CurrentPage
                Next
            Else
                Imaging1.TiffOpenMultiPageAsReadOnly (True)
                nTifImageID = Imaging1.CreateImageFromFile(DuplicateThumbName)
               
                If nTifImageID <> 0 Then
                    For i = 1 To Imaging1.TiffGetPageCount(nTifImageID)
                        Call Imaging1.TiffSelectPage(nTifImageID, i)
                        PDFThumbID = Imaging1.CreateThumbnailHQEx(nTifImageID, 100, 100, LightGray)
                       
                        tempImageKey = "image" & Trim(i) * Rnd
                        Call ImageList1.ListImages.Add(, tempImageKey, Imaging1.GetPictureFromGdPictureImage(PDFThumbID))
                        ListView1.ListItems.Add , tempImageKey, ThumbfileName & " Page " & i, tempImageKey, 1
                       
                        Imaging1.CloseImage (PDFThumbID)
                    Next
                End If
                Call Imaging1.TiffSelectPage(nTifImageID, 1)
                GdViewer1.SetNativeImage (Imaging1.GetNativeImage())
            End If
            GdViewer1.LockControl = False
            'StatusBar1.SimpleText = "Thumbnail Loaded Sucessfully"
            Call ResetComponents("Thumbnail Loaded Sucessfull") 'RESETTING LOCKED COMPONENTS
        End If
       
    End If
    Exit Sub
   
handleException:
    MsgBox "Error Occured during Creating Thumbnail." & vbCrLf & Err.Description & vbCrLf & " GD: " & GdViewer1.GetStat & " IMG: " & Imaging1.GetStat & vbCrLf & "temp key " & tempImageKey & " imaging key " & PDFThumbID
    GdViewer1.LockControl = False
    Call ResetComponents("Error Loading Thumbnail")
End Sub



-Thanks,
Viral
Thank you,

Viral Kothari
Software Eng.
Image
User avatar
kviral
 
Posts: 54
Joined: Thu Oct 01, 2009 3:53 pm
Location: Tarrytown, NY

Re: cant handle more no. of pages while creating thumbnail

Postby Loïc » Tue Nov 10, 2009 10:00 pm

Hi,

Please, send the PDF to esupport (at) gdpicture (dot) com for investigation.

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: cant handle more no. of pages while creating thumbnail

Postby kviral » Wed Nov 11, 2009 11:48 am

Hi Loic,

I've sent u the PDF.

-Thanks,
viral kothari
Thank you,

Viral Kothari
Software Eng.
Image
User avatar
kviral
 
Posts: 54
Joined: Thu Oct 01, 2009 3:53 pm
Location: Tarrytown, NY


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 3 guests

cron