问题描述
我想在当前目录中打印所有pdf。
当我在cmd( singlepdf.sh
)中调用此bash脚本时:
'C:\Program文件x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe'/ t Gemeinde_348_BioID_842_alt.pdf
一切正常。
I'm trying to print all pdfs in current dir. When I call this bash script in cmd (singlepdf.sh
):'"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"' /t Gemeinde_348_BioID_842_alt.pdf
everything's working fine.
使用此内容调用 multiplepdfs.sh
时:
declare -a pdfs=(*.pdf)
for pdf in ${pdfs[@]}; do
echo -e "\nprinting **$pdf** with AcroRd32.exe...\n"
'"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"' /t $pdf
sleep 3
done
echo显示文件在循环中被正确寻址 - 但是我得到错误C:\Program Files(x86)\Adobe \Reader 10.0 \Reader \\ \\ AcroRd32.exe:没有这样的文件或目录
The echo shows that files are addressed correctly in the loop - but then I get the error "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe": No such file or directory
有人可以帮助解决这个问题吗?
Can someone help out with this issue?
编辑:
BTW,我安装了msys mingw
BTW, I have msys mingw installed
推荐答案
- 命令行API不受官方支持,因此可以更改或
- 发送打印命令到Reader加载GUI,似乎没有办法阻止它。我需要该过程对用户透明。
我偶然发现了,建议使用。福昕阅读器是免费的,API几乎与Acrobat Reader完全相同,但最重要的是文档,并且不会为打印作业加载GUI。
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???
这篇关于从Windows命令行打印PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!