我在Windows系統上使用ghostscript 9.19。 當我從批處理文件運行ghostscript時,它創建pdf。 當ghostscript從程序計劃時,它會創建一個沒有內容的pdf - 只有一個空白頁面。 的命令行是在兩種情況下是相同的(一個龍線,下面分裂由於格式化):從未被創建ghostscript轉換爲pdf-a-icc文件是否正確?
gswin32c.exe -sstdout=d:\my_data\gs_stdout.log
-dPDFA=1 -dBATCH -dNOPAUSE -dNOOUTERSAVE
-sColorConversionStrategy=/RGB
-sOutputICCProfile=d:\my_ps_files\AdobeRGB1998.icc
-sDEVICE=pdfwrite
-sOutputFile=d:\my_data\my_hopeful_pdfa_pdfa.pdf
-dPDFACompatibilityPolicy=1 "d:\my_ps_files/PDFA_def.ps" "d:\my_data\my_hopeful_pdfa_pdfa.ps"
> d:\my_data\my_hopeful_pdfa_gs_out.log
my_hopefule_pdfa_gs_out.log。但gs_stdout.log確實被創建。
無論是PDF格式被創建似乎關係到* .icc文件是否不存在的目錄中ghostscript的運行。
我得到的stdout.log文件不同的輸出。
當它工作,我得到:
GPL Ghostscript 9.19 (2016-03-23)
Copyright (C) 2016 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefinedfilename in (>)
Operand stack:
false
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1201/1684(ro)(G)-- --dict:0/20(G)-- --dict:80/200(L)--
Current allocation mode is local
Last OS error: Invalid argument
當它失敗的錯誤日誌:
GPL Ghostscript 9.19 (2016-03-23)
Copyright (C) 2016 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefinedfilename in --file--
Operand stack:
--nostringval-- --nostringval-- (AdobeRGB1998.icc) (r)
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1967 1 3 %oparray_pop 1966 1 3 %oparray_pop 1950 1 3 %oparray_pop 1836 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1201/1684(ro)(G)-- --dict:0/20(G)-- --dict:79/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 818
有人可以幫我解釋這個輸出。 AdobeRGB1988.icc在這兩種情況下駐留在d:\ my_ps_files \ AdobeRGB1998.icc作爲在命令行指定。
您在'/ PDFA_def.ps'處使用正斜槓,該斜槓不是正常的Windows路徑分隔符。嘗試用反斜槓代替它。另一點是,從程序啓動時,環境變量可能會有所不同,但不知道程序以什麼方式啓動它,這很難說。 –