Loading a PDF into a GdPicture Object

Discussions about image processing and document imaging.
Post Reply
absoffthewake
Posts: 32
Joined: Wed Jul 18, 2007 11:58 pm

Loading a PDF into a GdPicture Object

Post by absoffthewake » Wed Aug 08, 2007 5:20 pm

I understand that you cannot load a PDF to a GDPicture Object directly from a file, but you can transfer the native image from the Viewer to it.

1 When I tried the native transfer it only did the first page, is there a way to transfer all the pages?

2 Are there any plans add this feature? If so, how long still you think it will be released?

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

Post by Loïc » Thu Aug 09, 2007 11:27 am

Hi,
#1 When I tried the native transfer it only did the first page, is there a way to transfer all the pages?
Yes, you can do that easily:

Draw a gdviewer object with the visible property to False.

And run this code to convert all the PDF pages as independent JPG files:

Code: Select all

Dim nCpt As Long
Dim oGdPicture As New GdpicturePro.cGdPicture
gdViewer1.SetIsedQuickPDFLicenceNumber ("343930329827F396959C620C21A04AAC")
gdViewer1.DisplayFromPdfFile ("c:\test.pdf")

For nCpt = 1 To gdViewer1.NumPages
    gdViewer1.DisplayFrame (nCpt)
    oGdPicture.SetNativeImage (gdViewer1.GetNativeImage)
    call oGdPicture.SaveAsJpeg("c:\extract" & Trim(Str(nCpt)) & ".jpg")
Next nCpt
Best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests