How to change Ghostscript output file (in printer spooler)

99封情书 提交于 2019-12-19 11:57:12

问题


I am using Ghostscript to print a PDF by command line arguments. But it shows the printed document's name as Ghostscript output in printer spooler. I want to change it to a custom name (as letter's name).


回答1:


Please refer to the documentation in http://www.ghostscript.com/doc/9.06/Devices.htm#Win

In particular there is an example in section 10.2 with explanation of the parameters that can be specified in section 10.3. Just changing the document name can be done by:

mark /UserSettings <</DocumentName (MyDocName)>> (mswinpr2) finddevice putdeviceprops setdevice

This can be put into a file as in the example, or can be in a string on the command line following a -c option. If you use -c instead of putting the above PostScript in a setup file, put it in as the last option before -f and the input-filename.

Note: You should not specify the -sDEVICE=mswinpr2 on the command line -- the setdevice takes care of this. I tested this on my laptop with the command line:

gswin32c \
  -dNOPAUSE -dBATCH \
  -c "mark /UserSettings <</DocumentName (MyDocName)>> (mswinpr2) finddevice putdeviceprops setdevice" \
  -f examples/colorcir.ps



回答2:


For this purpose you must use a setup.ps file as in this link under section: 6.2 Supported options (device properties)



来源:https://stackoverflow.com/questions/12348864/how-to-change-ghostscript-output-file-in-printer-spooler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!