View Full Version : PRS-500 Code to Convert PDF to Images

03-25-2007, 10:55 AM
With GhostScript ( ( & GFL SDK/GFLAx ( ( which is free you can convert PDF files to other image formats. I'm sure that GFL works with MS Visual C# Express and MS VB 2005, which are also free. The code listing below will convert the first 6 pages for FAQ.PDF to png files using vbscript. You can test it out by saving the code into a file called test.vbs and then double click on it run it.

option explicit

sub displaypage
const AX_PNG = 3
const numofpages = 6

Dim File, ThumbNail, imagepath, i
Set ThumbNail = createobject("GflAx.GflAx")

imagepath = "c:\test.png"
File = "c:\FAQ.pdf"

With ThumbNail
for i = 1 to numofpages
.EpsDpi = 72
.Page = i
.LoadBitmap File
.Saveformat = AX_PNG
.saveBitmap replace(imagepath,"test","test" & i)
end with
set ThumbNail=nothing
end sub

03-27-2007, 01:06 AM
sorry, i posted this in the wrong section...

04-19-2007, 04:25 PM
Very nice ! Thanks for the example on PDF conversion. Works like a charm.