问题
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