Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1058

Re: Can you send parameters to a postscript program

From "luser.droog" <luser.droog@gmail.com>
Newsgroups comp.lang.postscript
Subject Re: Can you send parameters to a postscript program
Date 2012-11-17 19:29 -0600
Organization unorganized
Message-ID <k89dl9$pnl$1@dont-email.me> (permalink)
References <87y5hzdedi.fsf@Compaq.site.inet>

Show all headers | View raw


Cecil Westerhof wrote:

> Is it possible to give parameters to a postscript program?
> 
> If so, is the following possible: I have defined colours. Say that I
> want to use colorYellow. Can I give the string collorYellow to the
> program and let setrgbcolour use the value of the variable
> colorYellow?
> 

Yes, there are several ways to pass parameters into a PS program.

The most obvious would be to concatenate the definitions in front of the
program text and then execute the whole thing. This way will work on ANY ps
interpreter.

Or you can use ghostscript's "code" option:

  gs -c '/param1 12 def' prog.ps

Or ghostscript's "define" options:

  gs -dPARAM -dPARAM1=12 -sSTRING=string prog.ps

Or ghostcript's "argument-passing" option

  gs -- prog.ps arg0 arg1 arg2

which predefines '/ARGUMENTS [ (arg0) (arg1) (arg2) ] def' before executing.

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Can you send parameters to a postscript program Cecil Westerhof <Cecil@decebal.nl> - 2012-11-18 00:00 +0100
  Re: Can you send parameters to a postscript program "luser.droog" <luser.droog@gmail.com> - 2012-11-17 19:29 -0600
    Re: Can you send parameters to a postscript program tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-11-17 22:49 -0500
  Re: Can you send parameters to a postscript program Don Lancaster <don@tinaja.com> - 2012-11-20 15:05 -0700
  Re: Can you send parameters to a postscript program bonomi@host122.r-bonomi.com (Robert Bonomi) - 2012-11-21 17:51 -0600

csiph-web