How to send binary data to printer?

How to send binary data to printer?

Post by Adrian Davi » Fri, 24 Aug 2001 00:53:02



I have some JetDirect Laserjet printers configured on a AIX 4.3.3 system. I
want to be able to print PCL overlays. I can create a file which contains
the overlay and the text to be printed, but I need to be able to send this
to the printer without the datastream being modified. On other Unix flavours
all of this (adding the overlay *and* getting it to the printer safely) can
be done with a simple interface script tweek, but I don't know where to
start with the AIX printing system. Yes I have RTFM, but it is still not
obvious to silly me!! Surely there must be a blinding simple way to do this?

Can anybody help?

Many Thanks,
   =Adrian=

 
 
 

How to send binary data to printer?

Post by LAIX Software Consultin » Fri, 24 Aug 2001 10:28:06


If you JUST want the queue not to format the job, that's easy.  Either:
1) Submit the job with pass-thru flag:   qprt -dp
2) Modify the virtual printer to pass-thru mode (smit chpq   or lsvirprt to
set _d=p)

If you want the queue to do all of this for you - it can be done.
1) Write a program that accepts print data as stdin and produces the desired
file as stdout.
2) lsvirprt to set  f=c and fc=/your/program
Now you have a filter which reads from stdin and its stdout procedes to the
printer.

An alternative is to write a print queue backend.  In /etc/qconfig:

qname:
    device = dname
dname:
    backend = /some/program

Where /some/program is your executable or script which accepts the input
filename (queued job) as a commandline argument (NOT as stdin) and does
whatever it needs to do with it (eg writes something to /dev/lp##)

Regards,
Paul

Quote:> I have some JetDirect Laserjet printers configured on a AIX 4.3.3 system.
I
> want to be able to print PCL overlays. I can create a file which contains
> the overlay and the text to be printed, but I need to be able to send this
> to the printer without the datastream being modified. On other Unix
flavours
> all of this (adding the overlay *and* getting it to the printer safely)
can
> be done with a simple interface script tweek, but I don't know where to
> start with the AIX printing system. Yes I have RTFM, but it is still not
> obvious to silly me!! Surely there must be a blinding simple way to do
this?

> Can anybody help?

> Many Thanks,
>    =Adrian=


 
 
 

How to send binary data to printer?

Post by Norman Levi » Fri, 31 Aug 2001 07:49:12


Check the backend in /etc/qconfig.  I think "piobe -p" will pass the data
thru.  


> If you JUST want the queue not to format the job, that's easy.  Either:
> 1) Submit the job with pass-thru flag:   qprt -dp
> 2) Modify the virtual printer to pass-thru mode (smit chpq   or lsvirprt to
> set _d=p)

> If you want the queue to do all of this for you - it can be done.
> 1) Write a program that accepts print data as stdin and produces the desired
> file as stdout.
> 2) lsvirprt to set  f=c and fc=/your/program
> Now you have a filter which reads from stdin and its stdout procedes to the
> printer.

> An alternative is to write a print queue backend.  In /etc/qconfig:

> qname:
>     device = dname
> dname:
>     backend = /some/program

> Where /some/program is your executable or script which accepts the input
> filename (queued job) as a commandline argument (NOT as stdin) and does
> whatever it needs to do with it (eg writes something to /dev/lp##)

> Regards,
> Paul


> > I have some JetDirect Laserjet printers configured on a AIX 4.3.3 system.
> I
> > want to be able to print PCL overlays. I can create a file which contains
> > the overlay and the text to be printed, but I need to be able to send this
> > to the printer without the datastream being modified. On other Unix
> flavours
> > all of this (adding the overlay *and* getting it to the printer safely)
> can
> > be done with a simple interface script tweek, but I don't know where to
> > start with the AIX printing system. Yes I have RTFM, but it is still not
> > obvious to silly me!! Surely there must be a blinding simple way to do
> this?

> > Can anybody help?

> > Many Thanks,
> >    =Adrian=

--
Norman Levin
VM/Dynamics, Inc - Specializing in VM, AIX and Linux Education
Office 817 421-0123    Mobile  817 919-8781    Fax 214-722-1779
 
 
 

1. How do I send binary data to my printer?

I need to write a graphics driver for my dot matrix printer for a
CS class.  I have tried to send control codes to the printer before,
but 'lpr' refuses, claiming the input is not a text file (even through
the codes were all less than 32).  I tried writing directly to /dev/lp
but I wasn't allowed, even as root (I think the message was "device busy").

Anyway, I hate to resort to DOS just so I can control the printer directly.
How can I send binary codes (0x00-0xFF) to the printer in raw form?
Do I need to bypass lpr, and if so, how can I do that?

Thanks,
Mike

--

2. S: How to compile my own X?

3. Sending binary data using send(2)

4. Need help with remote shell

5. Sending XML data to Apache web server and capturing this sent data from the Apache server

6. Web hit statistics generation

7. Binary data sent through unnamed pipes

8. NIS+ Dilemna [50 remote hosts]

9. send float,binary data over sockets

10. Q: How to send/receive raw binary data over serail port?

11. How to send binary data over socket...

12. How do I send jobs to remote printer(s) in binary form?

13. Can't send data to network printer