0

I have converted PDF to Postscript using ghostscript. The output generated is in encrypted format. I want to add Tray Switch and Duplex Printing command inside the Postscript so that printer is able to follow those. Is there any way to achieve?

Following is the command i am using to convert PS C:\Program Files\gs\gs9.22\bin\gswin64 -sDEVICE=pdfwrite -dCompressFonts=true -o D:\output\OutputFile.ps D:\output\InputFile.pdf

KenS
  • 30,202
  • 3
  • 34
  • 51
Prasun
  • 1

1 Answers1

0

First thing you shoudl do is use current code; the current version is 9.50. IIRC this version, by default, doesn't write compressed (not encrypted) output.

In addition that version has 2 controls, PSDocOptions and PSPageOptions, documented here which already allow you to do what you want. You will have to understand the PostScript syntax in order to use these.

KenS
  • 30,202
  • 3
  • 34
  • 51
  • Dear KenS, Thanks for your response. Can i have some sample command line to use PSDocOptions option also what if i want to used different command for different page of postscript. Eg; my First Page of postscript should have simplex command and other page shuuld be duplex. – Prasun Jan 30 '20 at 07:24
  • Command line: -c "<> setdistillerparams" -f If you want different content applied to different pages, then you need to use PSPageOptions. If you want to change Duplexing then you need to supply an array with sufficient strings for **every** page in the document. The first string should set Duplex to false, the second to true and every subsequent string needs to be empty. Note the documented warning about setpagedevice and using LockDistillerParams. – KenS Jan 30 '20 at 08:05