我做错了什么?
以下命令。
The 'pdfPathsAsStr' variable is:
\\someDir\subDir\T\Tools\Ghostscript_Tools\GS_Testing\IndividualPages\PDF_1.pdf \\someDir\subDir\T\Tools\Ghostscript_Tools\GS_Testing\IndividualPages\PDF_2.pdf
Completed:
(b'GPL Ghostscript 9.54.0 (2021-03-30)\nCopyright (C) 2021 Artifex Software, Inc. All rights reserved.\nThis software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:\nsee the file COPYING for details.\nError: /undefinedfilename in (\\\\\\\\someDir\\\\subDir\\\\T\\\\Tools\\\\Ghostscript_Tools\\\\GS_Testing\\\\IndividualPages\\\\PDF_1.pdf \\\\\\\\someDir\\\\subDir\\\\T\\\\Tools\\\\Ghostscript_Tools\\\\GS_Testing\\\\IndividualPages\\\\PDF_2.pdf)\nOperand stack:\n\nExecution stack:\n %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push\nDictionary stack:\n --dict:732/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)--\nCurrent allocation mode is local\nLast OS error: No such file or directory\n', None)
GPL Ghostscript 9.54.0: Unrecoverable error, exit code 1
显示远程Windows文件夹不是Ghostscript输入或输出的问题。
您的问题是Python处理Windows Pathing的方式,可以通过逆转文件夹名称来最大程度地减少该文件夹名称,以便只有服务器名称在Windows中需要\ prefix。
pdfPathsAsStr
中的python中使用
gswin64c -sDEVICE=pdfwrite -o"\\advent\share\Merged.pdf" "\\advent\share\cover.pdf" "\\advent\share\PDF files in a folder.pdf"
在需要时使用gswin64c -sDEVICE=pdfwrite -o"\\advent/share/Merged.pdf" "\\advent/share/cover.pdf" "\\advent/share/PDF files in a folder.pdf"