ITEM: E5223L

Printer problems after writing my own backend.



Question:

I have set up a virtual printer for an HP printer.  It works fine if I
use piobe, but if I use a backend that I wrote myself, then the HP
escape sequences are not being inserted.

my backend is:  /bin/cat $! | /usr/lpp/.. | lpr -h -G /nff P remqname

Response:

I told him how to create a queue which formats the output and then queues the
job to a remote printer.

Response:

Compile it and plug its fully-qualified pathname in for the value of
the mo attribute in some virtual printer definition.  The ownership
should be bin.bin and the permissions should be 555.

Jobs put on this queue will be formatted and then resubmitted to the
queue named test1, which can be a normal rembak queue.

There is still a problem with picking up a stray character from the
high end of the codepage somewhere in this process, but I haven't
found it yet. However, this is just sample code to demonstrate the
technique of redirecting formatted datastreams.

Using shell scripts is a really bad idea, as the communications
between the qdaemon and the backend are lost.  These communications
are very important for error determination and status checking.

\#include \
\#include \

main(int argc, char **argv)
{FILE *fp1 ;
char *ch[1] ;
int fd1, fd2 ;

if (NULL == (fp1 = (popen("/bin/qprt -Ptest1","w"))))
  {
   perror("popen") ;
   exit(0) ;
  }

fd2 = fileno(fp1) ;

while (0 != (read(STDIN_FILENO,ch,1)))
 write(fd2,ch,1) ;

fflush(fp1) ;
pclose(fp1) ;

exit(0) ;

}

Again, this is just a simple example and is not supported by IBM.


Support Line: Printer problems after writing my own backend. ITEM: E5223L
Dated: November 1993 Category: N/A
This HTML file was generated 99/06/24~13:30:54
Comments or suggestions? Contact us