![](/uploads/1/2/5/8/125838023/663868688.jpg)
Welcome to Foxit Reader (Enterprise Version) - your right choice to view and print. Type “msiexec” on the command line or visit Microsoft TechNet help center. I could not get Foxit Reader (v7.0.6) to print silently in the background. It opens a minimized version of the GUI and does not return control until it is manually closed:( So I ended up using SumatraPDF, which has the command line switches -print-to-default (or -print-to myprinter) and -silent that allows for completely silent background printing!! And the return code is 0 if it succeeds.
Active1 month ago
I'm trying to print all pdfs in current dir. When I call this bash script in cmd (
singlepdf.sh
):'C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe' /t Gemeinde_348_BioID_842_alt.pdf
everything's working fine.When calling
multiplepdfs.sh
with this content:The echo shows that files are addressed correctly in the loop - but then I get the error
'C:Program Files (x86)AdobeReader 10.0ReaderAcroRd32.exe': No such file or directory
Can someone help out with this issue?
Edit:BTW, I have msys mingw installed
Kay
KayKay1,65744 gold badges2323 silver badges3838 bronze badges
11 Answers
I know this is and old question, but i was faced with the same problem recently and none of the answers worked for me:
- Couldn't find an old Foxit Reader version
- As @pilkch said 2Printer adds a report page
- Adobe Reader opens a gui
After searching a little more i found this: http://www.columbia.edu/~em36/pdftoprinter.html.
It's a simple exe that you call with the filename and it prints to the default printer (or one that you specify).From the site:
PDFtoPrinter is a program for printing PDF files from the Windows command line. The program is designed generally for the Windows command line and also for use with the vDos DOS emulator.
To print a PDF file to the default Windows printer, use this command:
To print to a specific printer, add the name of the printer in quotation marks:
If you want to print to a network printer, use the name that appears in Windows print dialogs, like this (and be careful to note the two backslashes at the start of the name and the single backslash after the servername):
scriptsscripts99511 gold badge1515 silver badges2323 bronze badges
I had two problems with using Acrobat Reader for this task.
- The command line API is not officially supported, so it could change or be removed without warning.
- Send a print command to Reader loads up the GUI, with seemingly no way to prevent it. I needed the process to be transparent to the user.
I stumbled across this blog, that suggests using Foxit Reader. Foxit Reader is free, the API is almost identical to Acrobat Reader, but crucially is documented and does not load the GUI for print jobs.
A word of warning, don't just click through the install process without paying attention, it tries to install unrelated software as well. Why are software vendors still doing this???
kim3erkim3er4,27944 gold badges3535 silver badges6262 bronze badges
First response - wanted to finally give back to a helpful community...
Wanted to add this to the responses for people still looking for simple a solution. I'm using a free product by Foxit Software - FoxItReader.
Here is the link to the version that works with the silent print - newer versions the silent print feature is still not working.FoxitReader623.815_Setup
Here is the link to the version that works with the silent print - newer versions the silent print feature is still not working.FoxitReader623.815_Setup
I simply created a command to loop through the directory and for each pdf file (FOR %%f IN *.pdf) open the reader silently (/t) get the next PDF (%%f) and send it to the print queue (SPST-SMPICK), then delete each PDF after I send it to the print queue (del%%f). Shashank showed an example of moving the files to another directory if that what you need to do
Michael GarganMichael Gargan
Looks like you are missing the printer name, driver, and port - in that order. Your final command should resemble:
For example:
Note: To find the printer information, right click your printer and choose properties. In my case shown above, the printer name and driver name matched - but your information may differ.
rhp997rhp997
I had the similar problem with printing multiple PDF files in a row and found only workaround by using 2Printer software. Command line example to print PDF files:
It is free for non-commercial use at http://doc2prn.com/
LeiLei
The error message is telling you.
Try just
When you enclose the string in single-quotes, this makes everything inside a valid string, including the
'
chars. By removing the single-quotes, the shell will process the dbl-quotes as string 'wrappers'. I would also wrap the filename variable in dbl-quotes so you can easily process files with spaces in their names, i.e.
IHTH
shelltershellter30.5k66 gold badges6363 silver badges7979 bronze badges
Using Acrobat reader is not a good solution, especially command line attributes are not documented. Additionally Acrobat reader's window stays open after printing process. PDF files are well known by printer drivers, so you may find better tools, like 2Printer.exe or RawFilePrinter.exe. In my opinion RawFilePrinter has better support and clear licencing process (you pay donation once and you can redistribute RawFilePrinter in many project you like - even new versions work with previously purchased license)
Latest version to download: http://bigdotsoftware.pl/index.php/rawfileprinter
Michael A. Schaffrath1,13111 gold badge88 silver badges1919 bronze badges
zukozuko
Try this..May be u have some other version of Reader so that is the problem..
David Arenburg80.8k1313 gold badges104104 silver badges168168 bronze badges
Shashank BhatShashank Bhat
Today I was looking for this very solution and I tried PDFtoPrinter which I had an issue with (the PDFs I tried printing suggested they used incorrect paper size which hung the print job and nothing else printed until resolved). In my effort to find an alternative, I remembered GhostScript and utilities associated with it. I foundGSView and it's associated program GSPrint (reference https://www.ghostscript.com/). Both these require GhostScript (https://www.ghostscript.com/) but when all the components are installed, GSPrint worked flawlessly and I was able to create a scheduled task that printed PDFs automatically overnight.
Multiverse ITMultiverse IT
Here is another solution:
1) Download SumatraPDF (portable version) - https://www.sumatrapdfreader.org/download-free-pdf-viewer.html
2) Create a class library project and unzip the SumatraPDF.exe to the project directory root and unblock it.
3) Inside the project Properties, go to the Resoruces tab and add the exe as a file.
4) Add the following class to your library:
5) Enjoy printing pdf files from your code.
Use like this:
Mike CheelMike Cheel8,46777 gold badges5454 silver badges8282 bronze badges
![Command Command](/uploads/1/2/5/8/125838023/301057489.jpg)
Another solution 'out of the box'
FOR %X in ('*.pdf') DO (C:WindowsSystem32print.exe /d:'printername' '%X.pdf')
JulienJulien
Not the answer you're looking for? Browse other questions tagged windowspdfprintingcmdsh or ask your own question.
Active6 months ago
Good Morning (or Day or Night),
I have a network drive with 10s of thousands of PDFs. Any given week, I have to print off 500-1000 different ones, depending on the work I am doing. I know in advance, which PDFs will be needed. I would need to print these PDFs in a specific order. (they are engineering blueprints)
I've attempted to use the command line and print out pdfs, to test to see if I could add them to a batch file and print them all in sequence, but every time I attempt to do so the application I am trying to use (doesnt matter which so far) opens up and prints. It would need to print and close or not open at all, as I am limited in computer resources/time.
Edit
Currently I've tried the following, without my expected result:
J:30000's31121-015-O.pdf is currently being printed
This actually just states its being printed, I think the PRINT command is to blame. I can rerun it and get a different response:
Unable to initialize device IP_172.31.86.2
Which confuses me as I've verified the printer port and I'm specifying it.
I've also tried the following, which does work, but it leaves the application open (cant have this):
I get similar results from Adobe Reader DC.
Any suggestions or sample cmd line syntax/switches that you think I might be able to learn from? I do not have a linux/unix machine to work from, just windows 7. If you have suggestions on an alternative method to printing a large number of PDFs at once, please let me know. Perhaps using something similar to kill -9 foxitreader after each /p line in the bat file? Seems excessive, but I'm open to ideas!
Thank you for your time, have a good Sunday!
drpepperpickle
drpepperpickledrpepperpickle
1 Answer
I search around and found this command, and I want to help you with it
I think you need to change the command a little bit to make it connect to your network drive
( i don't know how right now )
or you can use this tool 2printer ( command line tool for printing )
KhalidProKhalidPro
Not the answer you're looking for? Browse other questions tagged command-linepdfbatchprintingprinter or ask your own question.
![](/uploads/1/2/5/8/125838023/663868688.jpg)