Universal Document Converter
Product Overview
Download
Purchase
Tutorials
Developer Solutions
Support Service
About fCoder Group


      Site search
   


      Video tutorial
Show tutorial



Main page>Developer Solutions>Popular Applications as COM-servers

Print Adobe PDF Document to Image Using Visual Basic 6.0


Universal Document Converter is virtual printer software that saves any document you print as an image file. Below is a source code example that can help you to accomplish your task with Universal Document Converter. Please let us know if you cannot find the solution you need.

' Adobe Acrobat Writer 4.0 or above and Universal Document Converter
' should be installed. Adobe Acrobat Reader does not have COM interface
' and cannot be used as COM-server!

Private Sub PrintAdobePDF(strFilePath As String)

' Run Adobe Acrobat Writer as COM-server
  On Error Resume Next
  Dim App As Object
  Dim AVDocument As Object
  Dim PDDocument As Object
  Dim nPages As Object

' Run Acrobat Writer as COM-server
  Set App = CreateObject("AcroExch.App")
  Set AVDocument = CreateObject("AcroExch.AVDoc")
        
' Open PDF document from file
  If AVDocument.Open(strFilePath, "") = True Then
  
    Set PDDocument = AVDocument.GetPDDoc()
    nPages = PDDocument.GetNumPages()
        
  ' Print all pages of the document
    Call AVDocument.PrintPagesSilent(0, nPages - 1, 0, True, True)
        
  ' Close the document
    Call AVDocument.Close(True)
    Set AVDocument = Nothing
    Set PDDocument = Nothing
    
  End If
    
' Close Adobe Acrobat Writer
  Call App.Exit
  Set App = Nothing
    
End Sub



Related topics
Popular pages
Popular solutions


© 2001-2012 fCoder Group, Inc. About fCoder Group | Privacy Policy | Site Map