PDF In-Depth

IAC - Printing using Acrobat Reader

November 13, 1998


This method prints the PDF c:\temp\filetoprint.pdf.

This code sample is posted here for the general benefit of the PDF development community. Attribution and usage guidelines are as noted in the code source; please respect the wishes of the author when using this code.

Option Explicit ' Force variable declaration	
' Author : Karl De Abrew
' Company : Planet PDF
' Date : 30 November, 1998
' Description: 
' This vb method uses the VB printer object and a command line call 
' sourced from the Acrobat Developer FAQ to print a single PDF silently	
' This method / function should be extended to suit the requirements
' of an organisation
Sub PrintAPDFUsingTheFreeAcrobatReader()
    Dim strCommandLine As String        
    Dim strPrinterName As String        
    Dim strDriverName As String        
    Dim strPortName As String        
    Dim strFileNameToPrint As String        
	    strFileNameToPrint = "c:\temp\filetoprint.pdf"
            strPrinterName = Printer.DeviceName
            strDriverName = Printer.DriverName
            strPortName = Printer.Port
              	' Perform some error checking here
        strCommandLine = "c:\acrobat3\reader\AcroRd32.exe /t """ + _
                   strFileNameToPrint + """ """ + _
                   strPrinterName + """ """ + _
                   strDriverName + """ """ + _
                   strPortName + """"
        If (Shell(strCommandLine, vbHide) <> 0)Then        
              MsgBox "Job has been sent to the printer using the command " 
+ strCommandLine
              End If
End Sub
PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

Download free demo

Why eBooks and mobile devices don't (yet) pose an existential threat to the PDF

Continuous upheaval is what makes watching the technology industry so exciting. David vs. Goliath battles are waged every day, with startups often winning against much larger businesses. For years and years, many have predicted the decline of the PDF given its age and perceived disadvantages. Today, with the PDF losing ground in emerging areas like mobile and eBooks, the calls for its ultimate demise are growing louder.

February 02, 2016
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist 12

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.