

Adobe Acrobat API allow to print only on the default printer UDC::IProfilePtr itfProfile = itfPrinter->Profile UDC::IUDCPrinterPtr itfPrinter = pUDC->Printers UDC::IUDCPtr pUDC(_uuidof(UDC::APIWrapper)) Import Universal Document Converter software API: #import " progid:udc.apiwrapper" rename_namespace(" UDC") Rename_namespace(" ACROBAT"), auto_rename Acrobat 9.0 -> "C:\\Program Files\\Adobe\\Acrobat 9.0\\Acrobat\\acrobat.tlb" #import " C:\\Program Files\\Adobe\\Acrobat 4.0\\Acrobat\\acrobat.tlb"\ Acrobat 8.0 -> "C:\\Program Files\\Adobe\\Acrobat 8.0\\Acrobat\\acrobat.tlb" Acrobat 7.0 -> "C:\\Program Files\\Adobe\\Acrobat 7.0\\Acrobat\\acrobat.tlb" Acrobat 6.0 -> "C:\\Program Files\\Adobe\\Acrobat 6.0\\Acrobat\\acrobat.tlb" Acrobat 5.0 -> "C:\\Program Files\\Adobe\\Acrobat 5.0\\Acrobat\\acrobat.tlb" Acrobat 4.0 -> "C:\\Program Files\\Adobe\\Acrobat 4.0\\Acrobat\\acrobat.tlb" C:\\Program Files (x86)\\ in all paths. For 64-bit version please change C:\\Program Files\\ to Import Acrobat libraries for 32-bit version of Windows. and ::CoUninitialize() before closing it. Please insert ::CoInitialize(0) in your application initialization You must initialize the COM before you call any COM method. Universal Document Converter version 5.2 or higher should be installed as well. Please note that Adobe Acrobat Reader does not have COM interface and Adobe Acrobat version 4.0 or higher should be installed and activated on your PC. Microsoft Visual Studio version 2003 or higher. This example was designed to be used in Microsoft Visual C++ from ' Open PDF document from file If itfAVDocument.Open(strFilePath, "") = True Then Set itfPDDocument = itfAVDocument.GetPDDoc()Įnd If ' Close Adobe Acrobat Writer Call objAdobeApp.ExitĬ++ PDF to JPG conversion code example ////////////////////////////////////////////////////////////////// Set itfAVDocument = CreateObject(" AcroExch.AVDoc") ' Run Adobe Acrobat as COM-server On Error Resume Next Set objAdobeApp = CreateObject(" AcroExch.App") ' Value of %APPDATA% variable should be received using Windows API's ' Load profile located in folder "%APPDATA%\UDC Profiles". Set itfPrinter = objUDC.Printers(" Universal Document Converter") ' Use Universal Document Converter API to change settings of converterd document Set objUDC = New UDC.APIWrapper Private Sub PrintAdobePDFToJPEG(strFilePath As String)ĭim objAdobeApp As Object Dim itfAVDocument As Object Dim itfPDDocument As Object Dim nPages As Long Dim objUDC As IUDC ' 5) In the list of references check Universal Document Converter Type Library ' 4) In Visual Basic main menu press Project->References ' 3) Open your project in Microsoft Visual Basic 6.0. ' 2) Universal Document Converter 5.2 or above should be installed as well

VB PDF to JPG conversion code example: '. ' Close the document Call itfAVDocument.Close( True)Įnd If ' Close Adobe Acrobat Writer Call objAdobeApp.Exit() ' Print all pages of the document Call itfAVDocument.PrintPagesSilent(0, nPages - 1, 0, True, True) ' Open PDF document from file If itfAVDocument.Open(strFilePath, "") = True Then ItfAVDocument = CreateObject(" AcroExch.AVDoc") ObjAdobeApp = CreateObject(" AcroExch.App") ' Run Adobe Acrobat as COM-server On Error Resume Next ProfilePath = Path.Combine(AppDataPath, " UDC Profiles\PDF to JPEG.xml") Or you can move default profiles into a folder you prefer.ĪppDataPath = Environment.GetFolderPath() ' Value of %APPDATA% variable should be received using Environment.GetFolderPath ObjUDC.DefaultPrinter = " Universal Document Converter" ' Adobe Acrobat API allow to print only on the default printer ItfPrinter = objUDC.Printers(" Universal Document Converter") Private Sub PrintAdobePDFToJPEG(ByVal strFilePath As String)ĭim objAdobeApp As Object Dim itfAVDocument As Object Dim itfPDDocument As Object Dim nPages As Long Dim objUDC As UDC.IUDCĭim AppDataPath As String Dim ProfilePath As String ' Use Universal Document Converter API to change settings of converterd document ' Universal Document Converter Type Library ' 5) In Add Reference window go to COM tab and double click on ' 4) In the Visual Basic main menu press Project->Add Reference. ' 3) Open your project in Microsoft Visual Basic.NET. ' 2) Universal Document Converter version 5.2 or higher should be installed as well. ' Please note that Adobe Acrobat Reader does not have COM interface and ' 1) Adobe Acrobat version 4.0 or higher should be installed and activated on your PC. VB.NET PDF to JPG conversion code example: '.
