'----------------------------------------------------------------------
' 1) Adobe Acrobat Writer 4.0 or above should be installed and activated on your PC.
' Adobe Acrobat Reader does not have COM interface and cannot be used as COM-server!
'
' 2) Universal Document Converter 5.2 or above should be installed, too.
'
' 3) Open your project in Microsoft Visual Basic 6.0.
'
' 4) In Visual Basic main menu press "Project->References".
'
' 5) In the list of references check "Universal Document Converter Type Library".
'----------------------------------------------------------------------
Private Sub PrintAdobePDFToJPEG(strFilePath As String)
Dim objAdobeApp As ObjectDim itfAVDocument As ObjectDim itfPDDocument As ObjectDim nPages As LongDim objUDC As IUDC
Dim itfPrinter As IUDCPrinter
Dim itfProfile As IProfile
' Use Universal Document Converter API to change settings of converterd documentSet objUDC = New UDC.APIWrapper
Set itfPrinter = objUDC.Printers("Universal Document Converter")
Set itfProfile = itfPrinter.Profile
' Adobe Acrobat API allow to print only on the default printer
objUDC.DefaultPrinter = "Universal Document Converter"
' Load profile located in folder "%APPDATA%\UDC Profiles".' Value of %APPDATA% variable should be received using Windows API's SHGetSpecialFolderPath function.' Or you can move default profiles into a folder you prefer.
itfProfile.Load("PDF to JPEG.xml")
itfProfile.OutputLocation.Mode = LM_PREDEFINED
itfProfile.OutputLocation.FolderPath = "C:\Out"
itfProfile.PostProcessing.Mode = PP_OPEN_FOLDER
' Run Adobe Acrobat as COM-serverOn Error Resume NextSet objAdobeApp = CreateObject("AcroExch.App")
Set itfAVDocument = CreateObject("AcroExch.AVDoc")
' Open PDF document from fileIf itfAVDocument.Open(strFilePath, "") = TrueThenSet itfPDDocument = itfAVDocument.GetPDDoc()
nPages = itfPDDocument.GetNumPages()
' Print all pages of the documentCall itfAVDocument.PrintPagesSilent(0, nPages - 1, 0, True, True)
' Close the documentCall itfAVDocument.Close(True)
Set itfAVDocument = Nothing
Set itfPDDocument = Nothing
End If' Close Adobe Acrobat WriterCall objAdobeApp.Exit
Set objAdobeApp = Nothing
End Sub