Call pdf reader to print pdf files using a command line

If you are running a web server, you may need to print a number of pdf documents with batch script. Batch scripts need to call applications supported being run in MS-DOS mode. This article is to introduce an application of printing pdf documents via a command line. This software is named VeryPDF PDFPrint and this article will present the method of using this software to print a pdf document in a command line.

You can download this program at http://www.verypdf.com/pdfprint/index.html. All the components of the software are packed into a zip file and you have to unpack it before using it. Unpack the package of VeryPDF PDFPrint downloaded from the URL above to any directory that you prefer and you will see a executable file named “pdfprint.exe” in the directory that you chose. Now you can directly call the executable file in the directory via a command line. In this article, the author uses the directory of “D:\pdfprint_cmd” for storing the components of the software.

Here is the way to launch MS-DOS command prompt window: 1, follow the menu path, [start] –> [Run…], input “cmd” in the popup “Run” dialog and press “OK”. Then you will see a MS-DOS command prompt window presented in the following screen snapshot.

image

The default current directory of the MS-DOS prompt window is “C:\Documents and Settings\USER” as displayed in the screen snapshot above. You can call the program in this directory with specifying the whole path of the executable file of PDFPrint. For example, the commands are:

C:\Documents and Settings\admin>D:\pdfprint_cmd\pdfprint.exe D:\pdfprint_cmd\readme.pdf <Enter>.

This command line will call the executable file named “pdfprint.exe” stored in “D:\pdfprint_cmd\” and print the pdf document “D:\pdfprint_cmd\readme.pdf” using the system default printer.

You can also use the following commands to change the directory to the one that VeryPDF PDFPrint is stored in.

D: <Enter>

cd pdfprint_cmd <Enter>

After executing the commands above, the current directory will changed from the default one “C:\Documents and Settings\admin\” to “D:\pdfprint_cmd\”. After change the current directory to the one where PDFPrint is stored, you can directly call the program with its filename without the whole path. The following is an example of calling the program in its directory.

pdfprint readme.pdf <Enter>.

The command call the executable file of PDFPrint in the current directory and print the pdf document “readme.pdf”  using the default system printer.

The following words are about printing a pdf document via calling the associated pdf reader. The option of “-shell” or “-shell2” will be used in the following descriptions.

The command line as follow will call the associated pdf reader to print the pdf document “readme.pdf” that is stored in the directory of PDFPrint.

pdfprint -shell readme.pdf <Enter>

If the option “-shell” does not work for your current system condition, you may try the other option “-shell2” to finish the printing with calling the associated pdf reader. The command line is the following.

pdfprint -shell2 readme.pdf <Enter>.

Options “-shell” and “-shell2” use two different methods to call the associated pdf reader and print the pdf document in a command line. These two different methods are for different system conditions. If you find one of them does not work for your system condition, please try another option.

The words above present a method of printing pdf document via a command line using VeryPDF PDFPrint. If you want to use the full function version of the program, you can buy it at http://www.verypdf.com/order_pdfprint_cmd_svr.html.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in PDF Print and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!