How to automate specify the PDF page and the printing by using command line option of FoxitReader

use_foxit_PDF_command_line_options_top

How to use command line option on High-performance PDF software that can be used free, “Foxit Reader” (paid versions: Foxit PhantomPDF). You can automate entering password, open any page and print file etc… only single action by use the command line option.

As the following image, Click Help>Command line option in Foxit Reader menu, description will appear.

Meaning of the command line options

This was little difficult for me to understand. “|” mean is simply “or”, not a pipe command. It is the meaning of are summarized below.

Meaning of the command line options

You can perform the following functions when you open a file, by using the /A option , such as opening a factor how much any page . It is described in the user manual what are some of options.

For example, if you want to open file fifth page at a magnification of 50% of the PDF file that protect by password,

pdf_open_sample1.bat

"C:\Program Files (x86)\Foxit Software\Foxit J-Reader\Foxit Reader.exe" "D:\sample.pdf" /pwd yourpassword /A page=5 zoom=50
and After enter this command in text file and save as batch file, you can open file in this option without entering password by execution batchfile.

However, some PDF file can not be go to the page even if the page specified. So I resolve this case by following command. (But that way is not refreshing.)

pdf_open_sample2.bat

start "C:\Program Files (x86)\Foxit Software\Foxit J-Reader\Foxit Reader.exe" "D:\sample2.pdf" /pwd yourpassword
start /wait ping -n 3 localhost 
"C:\Program Files (x86)\Foxit Software\Foxit J-Reader\Foxit Reader.exe" /A page=5 "D:\sample2.pdf" 

Open the file in the first line. In the second line, Open a new command prompt and hit ping to own address while 3 seconds. Because waiting the file to open completely And after 3 seconds attach file is opened in the third line. Please adjust seconds to untile file open.

You can use the / p command when you want to print. For example, to printed on the default printer of the same file…

pdf_print_sample1.bat

"C:\Program Files (x86)\Foxit Software\Foxit J-Reader\Foxit Reader.exe" /pwd yourpassword /p "D:\sample.pdf"

When you want use specify a printer,

pdf_print_sample2.bat

"C:\Program Files (x86)\Foxit Software\Foxit J-Reader\Foxit Reader.exe" /pwd yourpassword /t "D:\sample.pdf" "PrinterName"
like this, use the / t command with specify the name of the printer. Printer name should be specify a name listed in General tab appear when select “Printer properties” in “Control Panel\Hardware and Sound\Devices and Printers”

いいねとおもったらシェア!

Leave a Reply

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