问题描述 投票:0回答:1
我看上去有几个地方在Ghostscript中的UNC路径方面有帮助,但找不到太多帮助。我尝试了该功能内部的一些变体,没有运气。

我做错了什么?

	

以下命令。

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"

对于服务器前缀,但在路径上使用 /在路径上使用以使生活更轻松(是的,这不是最好的练习,但生活很短,键盘的RSI较少)。
python python-3.7
1个回答
1
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.