0

我需要更改正在打印的 DocumentName。此文档名称将显示在打印机假脱机中。我正在使用 Ghostscript c# 包装器打印 PDF。它在打印机假脱机列表中显示“Ghostscript 输出”。Ghostscript 文档提供了一种方法,但我没有设法使其工作。

他们在 10.2 节中对其进行了描述。 https://www.ghostscript.com/doc/9.26/Devices.htm#Win

这是我尝试使用 CLI 运行的内容:

gswin64c.exe "D:\setup.ps" -o "D:/test.pdf" "C:\Users\ashish\Documents\tt.pdf"

安装程序.ps

mark
  /NoCancel      true                       % don't show the cancel dialog
  /BitsPerPixel  4                          % force 4 bits/pixel
  /UserSettings
    <<
      /DocumentName  (Ghostscript document) % name for the Windows spooler
      /MaxResolution 360                    % maximum document resolution
    >>
  (mswinpr2) finddevice                     % select the Windows device driver
  putdeviceprops
setdevice

结果:

GPL Ghostscript 9.52 (2020-03-19)
Copyright (C) 2020 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
| c:\Users\cjl\artifex\gs-release\9.52\ghostpdl-9.52\base\gsicc_manage.c:1888: gsicc_verify_device_profiles(): Mismatch of ICC profiles and device color model
| c:\Users\cjl\artifex\gs-release\9.52\ghostpdl-9.52\base\gsicc_manage.c:2015: gsicc_set_device_profile(): Error in device profiles
Error: /undefined in --.systemvar--
Operand stack:
   rangecheck   --dict:736/1123(ro)(G)--   .putdeviceprops
Execution stack:
   %interp_exit   .runexec2   --nostringval--   .systemvar   --nostringval--   2   %stopped_push   --nostringval--   .systemvar   .systemvar   false   1   %stopped_push   1990   1   3   %oparray_pop   1989   1   3   %oparray_pop   1977   1   3   %oparray_pop   1833   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   .systemvar   --nostringval--   2   %stopped_push   --nostringval--   1831   8   3   %oparray_pop   .systemvar   1814   8   3   %oparray_pop   .systemvar   1808   2   3   %oparray_pop
Dictionary stack:
   --dict:736/1123(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--
Current allocation mode is local
Last OS error: Permission denied
Current file position is 430
GPL Ghostscript 9.52: Unrecoverable error, exit code 1

谢谢

4

0 回答 0