Universal Document Converter
Informazioni sul prodotto
Scarica
Acquista
Tutorial
Soluzioni per sviluppatori
Servizio di assistenza
Chi è fCoder SIA


      Cerca nel sito
   


      Conversioni più richieste
Da Adobe PDF a JPEG
Da documento Word a PDF
Da foglio di lavoro Excel a PDF
Da PowerPoint a JPEG
Da disegno Visio a PDF
Da disegno AutoCAD a TIFF
Da pagina Web a JPEG
Convertire di lavoro Excel in PDF
Convertire da DjVu in PDF
Pagine Web in PDF



Pagina principale>Developer Solutions>Examples>Visual Basic 6>PDF Documents to JPEG

Converting PDF Documents to JPEG


'----------------------------------------------------------------------
' 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 Object
  Dim itfAVDocument As Object
  Dim itfPDDocument As Object
  Dim nPages As Long

  Dim objUDC As IUDC
  Dim itfPrinter As IUDCPrinter
  Dim itfProfile As IProfile

' Use Universal Document Converter API to change settings of converterd document
  Set 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"

  itfProfile.Load ("C:\Program Files\Universal Document Converter\UDC Profiles\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-server
  On Error Resume Next
  Set objAdobeApp = CreateObject("AcroExch.App")
  Set itfAVDocument = CreateObject("AcroExch.AVDoc")
    
  ' Open PDF document from file
  If itfAVDocument.Open(strFilePath, "") = True Then
  
    Set itfPDDocument = itfAVDocument.GetPDDoc()
    nPages = itfPDDocument.GetNumPages()
       
  ' Print all pages of the document
    Call itfAVDocument.PrintPagesSilent(0, nPages - 1, 0, True, True)

  ' Close the document
    Call itfAVDocument.Close(True)
    Set itfAVDocument = Nothing
    Set itfPDDocument = Nothing
    
  End If
    
' Close Adobe Acrobat Writer
  Call objAdobeApp.Exit
  Set objAdobeApp = Nothing


End Sub


© fCoder SIA Chi è fCoder SIA | Mappa del sito