GhostScript, How to set custom page size using command line?

萝らか妹 提交于 2021-02-11 01:16:16

问题


I know that have a simillar question : How to change Ghostscript output file (in printer spooler)

but the answers was not helpful

I using the command :

-q -dBATCH -dNOPAUSE -dNODISPLAY -c "mark /NoCancel true /OutputFile (%printer%Ricoh c2051) /UserSettings << /DocumentName (Test) /MaxResolution 600 >> (mswinpr2) finddevice putdeviceprops setdevice" -f "C:\duplex.pdf"

to set a custom name for document, but if a try to use "-sPAPERSIZE=a4" still the outputpaper size is "LETTER".

then,how to change the paper type when I use these settings?

----Edit

after researching, I found out how to set the paper type.

just added "/ PageSize [595 842]" (a4) at the prompt

then the line becomes:

-q-dBATCH-dNOPAUSE-dNODISPLAY-c "mark / NoCancel true / OutputFile (% printer% Ricoh c2051) / PageSize [595 842] / UserSettings << / DocumentName (Test) / maxResolution 600 >> (mswinpr2) FindDevice setdevice putdeviceprops "-f" C: \ duplex.pdf "****


回答1:


Your basic problem is that unless you set a fixed media size Ghostscript will set the media size to that which is requested n the PDF file (it will do this for PostScript input as well). Set -dFIXEDMEDIA to fix the media size.

In addition, the mswinpr2 device does not attempt to set the media size on the printer (assuming it has more than one), but simply uses the default.



来源:https://stackoverflow.com/questions/23014636/ghostscript-how-to-set-custom-page-size-using-command-line

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