since Adobe released a new Update for the Adobe Reader (11.09 on 16.09.2014), we encountered an problem with printing pdf files through the command line.
Our formally script looks like this:
:job
@for /F "tokens=1,* delims= " %%p in ('dir /b/a-d /s "Y:\*.pdf"') do (
echo Printing file: "%%p" on %date%
::prints the pdf document with adobe reader
"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /p /h "%%p"
::move file to destination
echo wait 10 seconds
::wait 10 seconds then continue
ping 127.0.0.1 -n 10 > nul
echo move file: "%%p" to "C:\PDF"
::move file to destination
move "%%p" "C:\PDF"
echo moved successfully!
echo proceeding next file
)
echo waiting for files to print...
echo wait 7 seconds
ping 127.0.0.1 -n 7 > nul
::clear console
cls
::repeat with job (endless loop)
goto job
The script was working as expecting before. Since the update the script often hangs or is mega slow. the script got more or less useless.
Cause the adobe reader is probably not the smallest, we also considered to use an lightweight alternativ like sumatrapdf or foxitreader. This would be a great point to start using one of those alternatives.
So I wanted to try it with sumatrapdf. Their documentation said:http://blog.kowalczyk.info/software/sumatrapdf/manual.html
=> -print-to-default $file.pdf prints a PDF file on a default printer
so ive come up to this, analog to the adobe reader example
:job
@for /F "tokens=1,* delims= " %%p in ('dir /b/a-d /s "Y:\*.pdf"') do (
call "C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" -print-to-default "%%p"
start "" "C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" -print-to-default "%%p"
"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" -print-to-default "%%p"
... the rest
But nothing works. If have also tried: "C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe -print-to-default" "%%p" for call,start, and so on...
Does anyboy know how to make the printing work with sumatrapdf? I also wouldn't be averse by making it work with foxit reader.
It would be a pleasure to get some advices :) Maybe someone got a similar problem to solve.