How to print PDF files from a command line to a Windows printer
This article discusses one way to print PDF files to a specific Windows printer, on the command line, using RPM Remote Print Manager®
What is the benefit to this? It's simple to print from any PDF viewer program. However, the method we outline below lets you print every PDF file you send to your system. 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 first.
Foxit Reader is a PDF viewer by Foxit Software which displays and prints PDF files. This program has proven to be very 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. Download: if you haven’t downloaded Foxit Reader yet, go to http://www.foxitsoftware.com/ and follow the Download link to get the software. Or, do a web search on "download foxit reader".
2. Printer name: Go to your Start menu and select "Devices and Printers". You’ll see something like the following, depending on which version of Windows you are using:
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:
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.
Please note: while we are impressed with the Foxit software and recommend it often, we have no affiliation with Foxit Corporation.