Loading...

Loading a PDF into a GdPicture Object

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

Loading a PDF into a GdPicture Object

Postby 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?
absoffthewake
 
Posts: 31
Joined: Wed Jul 18, 2007 11:58 pm

Postby 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
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest