gGt使用Ghostscript为每个文件包含一个PDF页面计数的输出文件 [英] gGt an output file with a count of PDF pages for each file with Ghostscript
问题描述
此代码对我有用,但我所有的文件都在网络驱动器上.在下面的示例中,仅当文件位于根目录(c:\
)中时,该代码才有效.
This code works for me, except all my files are on a network drive. In the example below, the code works only if the file is in the root directory (c:\
) as an example.
我必须用d:\hello space folder\filefolder\input.pdf
之类的东西替换input.pdf
吗?我试过了,但是发现了很多错误,说找不到目录.我尝试做netuse并映射网络主驱动器文件夹,但是那也不起作用.
Do I have to replace input.pdf
with something like d:\hello space folder\filefolder\input.pdf
? I tried this, but got a sleuth of errors saying directory not found. I tried to do netuse and map the network main drive folder, but that didn't work either.
gswin32c ^
-q ^
-dNODISPLAY ^
-c "(input.pdf) (r) file runpdfbegin pdfpagecount = quit"
推荐答案
您不能在PostScript字符串中使用单个反斜杠,因为这是转义字符.对于路径定界符,您需要使用两个反斜杠\\
来转义转义符,或者使用正斜杠/
代替.
You can't use a single backslash in a PostScript string, because that's the escape character. For the path delimiter you either need to use two backslashes \\
to escape the escape, or use a forward slash /
instead.
这篇关于gGt使用Ghostscript为每个文件包含一个PDF页面计数的输出文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!