How to print PDF files from a command line to a Windows printer

This article describes the steps to print PDF files to a Windows printer using RPM Remote Print Manager® (RPM). Using RPM you can set this up to run on demand day and night. Any time you sent a PDF file to RPM, your hard copy will soon be waiting.

Introduction

RPM is our virtual printer software.  It prints to more than one printer; archives to disk, converts print jobs to PDF and many other operations.

One of the operations RPM supports is to run a local program on your print job. All you need to do is install the program on your system, and RPM is ready to run it.

The method we outline below lets you print PDF files without selecting and clicking each file.

Many people use RPM to print, and at the same time, submit the PDF to a document management system or archive to disk. Often they use RPM to watermark the PDF before printing.

What happens when you view a PDF

When you double click on a file, Windows looks at the extension of the file. Using on that information, it looks up the viewer program for the file. You've seen what happens when you try to open a file and Windows asks what program you want to use.

When you view a PDF, Windows launches the viewer program and passes the path for your PDF on the command line. Don't worry if you are not familiar with that term! It just means the program can start viewing your PDF without asking you first for the file.

Getting started

Foxit Reader is a PDF viewer by Foxit Software which displays and prints PDF files. This program has proven to be popular with our customers and there seems to be quite a bit of good press for it on the Web, as well.

Now, here are the steps to print a PDF on the command line using the Foxit Reader.

  1. Do a web search on "download foxit reader". Follow the steps to download and install. When I tried this I found the software on http://www.foxitsoftware.com/
  2. Printer name: Go to your Start menu and select "Devices and Printers". Depending on the version of Windows you'll see a dialog like the following:

    Devices and Printers

    Select the printer you want to print to. Right click on this printer and select "Properties". You should get a window that resembles the following:

    Brother printer properties

    Please note how the printer name is highlighted. Select your printer name and copy it to the clipboard.

  3. Command line: The command line consists of these parts:
  • the path to the reader program, in quotes; for instance on my system it is "C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe"
  • the switch /t
  • the path to the PDF file
  • the name of the printer, in quotes; for instance, "Brother MFC-7840W"

For example, to print the file "temp.pdf" (a name we just made up) you would do this at a command line prompt:

"C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe" /t temp.pdf "Brother MFC-7840W"

When you do this, the only response you are likely to get is the printer warming up and your print job coming out. Foxit Reader does not seem to provide much feedback as to this operation being successful or not.

You may be asking--why go to the trouble of documenting a way to print something from a DOS command line? Please see the related article Printing PDF files from RPM Remote Print Manager to see where we are going with this.

Conclusion

Please note: while we are impressed with the Foxit software and recommend it often, we have no affiliation with Foxit Corporation.

Last updated May 17, 2016