Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > programming issue
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 25th February 18:44
External User
 
Posts: 1
Default programming issue



Hello,

Does gs currently have the ability to operate as a printer? By this I mean
that I intend to do the following:

1) Create two linux formated pcs with gs.
2) Run a null modem cable between the two serial ports.
3) Have one linux pc act as a postscript printer by taking control of the
serial port.
4) The other pc should not be able to see anything but a postscript printer
on
the other end of the cable. No linux, no networking, just a postscript
printer.

I thought maybe the following might work:

gs < /dev/ttyS02 ; it's S02 on my machine.

but, it didn't quite work.

All help appreciated.

If the printer job loop is programmed differently in ghostscript, which I
expect i.e. it expects data to come from a file instead, then could a few
mods be made to make it switch to a 'postscript printer' mode. Having the
two printer ports hooked up together would be ok also. Actually better ,
with
a direct connect cable (the same as a null modem cable?)


Sincerely, Roger.
Computer Networks, Plus.
The Software Guild. Inc.

Bringing postscript to underprivileged computer platforms since 1987.
  Reply With Quote


  sponsored links


2 28th February 01:53
lee sau dan
External User
 
Posts: 1
Default programming issue



amigaman> Hello, Does gs currently have the ability to operate as
amigaman> a printer?

Impossible by definition. gs is a software. A printer is a hardware.
How can you make a software operate as a printer? Can you make GIMP
operate as a scanner? Can you make gphoto operater as a camera, and
take it with you for shooting during your next vacation? If you can
make any software operate as hardware, then who will need hardware
anymore?


amigaman> By this I mean that I intend to do the following:

amigaman> 1) Create two linux formated pcs with gs. 2) Run a null
amigaman> modem cable between the two serial ports. 3) Have one
amigaman> linux pc act as a postscript printer by taking control
amigaman> of the serial port. 4) The other pc should not be able
amigaman> to see anything but a postscript printer on the other
amigaman> end of the cable. No linux, no networking, just a
amigaman> postscript printer.

You mean using gs to *emulate* a printer. Yes, that's possible. Yes,
that's possible in theory, although I don't know anyone have tried
that. Why do you need that when there is lpd/lpr?

And when you need to do something like that, write a daemon that
invokes gs, redirecting its standard input to /dev/ttyS0. You may
want to add some respawn code so that when gs dies because of
Postscript errors, you can start a new gs process.


amigaman> I thought maybe the following might work:

amigaman> gs < /dev/ttyS02 ; it's S02 on my machine.

amigaman> but, it didn't quite work.

What do you mean by "didn't quite work". Did you forget the power
switch?


BTW, you may want to use a flavour of 'getty' to set up the correct
parameters for your serial line, before gs takes input from it. You
would start 'getty' from /etc/inittab.

Also note the serial port settings (baud rate, parity, stop bit).
They have to match on both ends for successful communication.


amigaman> If the printer job loop is programmed differently in
amigaman> ghostscript, which I expect i.e. it expects data to come
amigaman> from a file instead, then could a few mods be made to
amigaman> make it switch to a 'postscript printer' mode.

Everything is a file is an important fundamental unix philosophy. I
don't think gs discriminates against serial lines. It should only
treat standard input as a stream of bytes.


amigaman> Having the two printer ports hooked up together would be
amigaman> ok also. Actually better , with a direct connect cable
amigaman> (the same as a null modem cable?)

You'll need a "LapLink parallel cable" and use the Linux PLIP driver
of Linux. Unfortunately, unlike RS232 ports, parallel ports are not
that well supported in Windows (if you're using it). Windows assumes
that you will only attach devices to the parallel port, not another
computer. It doesn't support PLIP.

--
Lee Sau Dan §õ¦u´°(Big5) ~{@nJX6X~}(HZ)

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666