> From [EMAIL PROTECTED] Mon Jul 10 09:29:43 2000
> Date: Mon, 10 Jul 2000 17:21:39 +0200 (CEST)
> From: Jesper Dangaard Brouer <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: LPRng: Problem with ifhp with respecting the "ps_eoj_at_start@"
>
>   This message is in MIME format.  The first part should be readable text,
>   while the remaining parts are likely unreadable without MIME-aware tools.
>   Send mail to [EMAIL PROTECTED] for more info.
>
> ---511536288-503108044-963242499=:30293
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
> Hi Patrick
>
> On Wed, 5 Jul 2000 [EMAIL PROTECTED] wrote:
>
> > Could you tell me what your printcap entry is,  and what printer
> > you are using?  
>
> hplspb|spb|HP 5Si MX, SP12|HP Laser 5si MX SPB, SP12
>  :ab
>  :ae=/xxx/accounting/accounting.pl end
>  :af=accounting.log
>  :as=/xxx/accounting/accounting.pl start
>  :bp=/xxx/accounting/psbanner.pl
>  :fx=flpdv
>  :generate_banner
>  :if=/hawktmp/ifhp-3.3.17/src/ifhp -Tpjl@,status@,sync@,pagecount@,ps_eoj_at_start@
>  :ifhp=model=hp5simx
>  :lp=spb%9100
>  :of=/hawktmp/ifhp-3.3.17/src/ifhp -Tstatus,sync@,pagecount,ps_eoj_at_start@
>  :ps=status
>  :rp=hplspb
>  :sd=/var/spool/lpd/%P
>  :sh@
>
> > I am a little puzzled why this is making a difference.
>
> Okay, my hack/trick is that I want a "bannerline", please note "line" not
> "page" (as in bannerpage).
>
> I have written some postscript-code which makes an bannerline on each page
> (see attachment: bannerpage.ps)
>
> My "old" printer system, were sending the print job as one ps-file,
> generated through our own filter. Now I want to upgrade to ifhp (it is
> much cleaner and better than our own filter).
>
> But bannerpage with ifhp, is done in 2 stages ...!
> ("of" prints the bannerpage, "if" prints the "real" job)
> That is 2 seperate print jobs, which means that my postscript code from
> the bannerpage.ps does NOT have any effekt on the second job.
>
> What I'm doing is in the above (in my printcap file), is to make sure that
> nothing happens between the 2 filters "of" and "if", so that my bannerline
> postscript code doesn't get "deleted", but survives in the printer.
>
>
> > > From [EMAIL PROTECTED] Tue Jul  4 15:15:48 2000
> > > Date: Tue, 4 Jul 2000 23:18:36 +0200 (CEST)
> > > From: Jesper Dangaard Brouer <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Subject: LPRng: Problem with ifhp with respecting the "ps_eoj_at_start@"
> > >
> > >
> > > Problem with ifhp with respecting the "ps_eoj_at_start@"
> > >
> > > My problem is that, 
> > >   there are too many CTRL-D,
> > >   between the postscript-code from the "of" filter and the "if" filter.
> > >
> > > I used to solve this problem, by specifying "ps_eoj_at_start@" (or as it
> > > recently was known "no_ps_eoj").
> > >
> > > If I don't specify "ps_eoj_at_start@", then 2 CTRL-D exist between the
> > > ps-code from "of" filter and the "if" filter If I do specify
> > > "ps_eoj_at_start@", then there is only 1 CTRL-D.
> > > (info: the easiest way to debug this, is by setting dev=/tmp/d )
> > >
> > > (versions) I have tried the different version of "ifhp", and the
> > > problem/error happens between version 3.3.12 and 3.3.13. (version 3.3.12
> > > works and 3.3.13 does not). (I'm running with 3.3.17)
> > >
> > >
> > > The problem, might be that the "of" filter, puts an CTRL-D after sending
> > > it's print job.  If this is the case, then I would like an
> > > "ps_eoj_at_end@" option, like the eksisting "ps_eoj_at_start@" option.
> > >
>
>
> Hilsen
>   Jesper Brouer
>
> -------------------------------------------------------------------
> System Administrator
> Dept. of Computer Science, University of Copenhagen
> E-mail: [EMAIL PROTECTED], Direct Tel.: 353 21375
> -------------------------------------------------------------------
>
> ---511536288-503108044-963242499=:30293
> Content-Type: APPLICATION/postscript; name="bannerline.ps"
> Content-Transfer-Encoding: BASE64
> Content-ID: <[EMAIL PROTECTED]>
> Content-Description: 
> Content-Disposition: attachment; filename="bannerline.ps"
>
> 
> %!PS
> 20 dict begin
> /bline true def
> /user (Hawk) def
> /job (test.ps) def
> /file (playing_with_postscript) def
> /host (badehat.diku.dk) def
> /date (Tue Jul  4 18:26:04 CEST 2000) def
> /printer (hplspb) def
> %
> % Bannerpage and bannerline postscript code
> %
> /mm { 25.4 div 72 mul } def
> /ef1 /Helvetica findfont [9 0 0 6 0 0] makefont def
> /ef2 /Courier   findfont [9 0 0 6 0 0] makefont def
> bline { %if
>   /mbline {
>     gsave
>     initgraphics
>     90 rotate
>     //ef1 setfont  32 //mm exec -8 //mm exec moveto (User: ) show
>         //ef2 setfont //user show
>     //ef1 setfont 112 //mm exec -8 //mm exec moveto (File: ) show
>         //ef2 setfont //file show
>     //ef1 setfont 192 //mm exec -8 //mm exec moveto (Date: ) show
>         //ef2 setfont //date show
>     //ef2 setfont 112 //mm exec -6 //mm exec moveto (Printed at ) show
>         //ef1 setfont (DIKU) show
>     grestore
>   } bind def
> } { /mbline { } def } ifelse
> << 
>      /EndPage { 2 ne dup { //mbline exec } if exch pop } bind 
> >> setpagedevice
> end

Well,  I have a solution but you will not like it.  I think.

First,  if I get this straight,  you want to

a) send some PostScript at the start of each PostScript file
b) have this PostScript 'configured' for each user.

Suppose that we append the following to the ifhp.conf file:

[ hp5simx ]
tc=hp5simx

ps_bannerline= 
 20 dict begin
 /bline true def
 /user (\%s{n}) def
 /job (\%s{J}) def
 /file (\%s{f}) def
 /host (\%s{H}) def
 /date (\%s{D}) def
 /printer (\s%{P}) def
 %
 % Bannerpage and bannerline postscript code
 %
 /mm { 25.4 div 72 mul } def
 /ef1 /Helvetica findfont [9 0 0 6 0 0] makefont def
 /ef2 /Courier   findfont [9 0 0 6 0 0] makefont def
 bline { %if
   /mbline {
     gsave
     initgraphics
     90 rotate
     //ef1 setfont  32 //mm exec -8 //mm exec moveto (User: ) show
          //ef2 setfont //user show
     //ef1 setfont 112 //mm exec -8 //mm exec moveto (File: ) show
          //ef2 setfont //file show
     //ef1 setfont 192 //mm exec -8 //mm exec moveto (Date: ) show
          //ef2 setfont //date show
     //ef2 setfont 112 //mm exec -6 //mm exec moveto (Printed at ) show
          //ef1 setfont (DIKU) show
     grestore
   } bind def
 } { /mbline { } def } ifelse
 << /EndPage { 2 ne dup { //mbline exec } if exch pop } bind >> setpagedevice
 end
ps_init+=[ bannerline ]


Now we use the same setup as before:


 hplspb|spb|HP 5Si MX, SP12|HP Laser 5si MX SPB, SP12
  :ab
  :ae=/xxx/accounting/accounting.pl end
  :af=accounting.log
  :as=/xxx/accounting/accounting.pl start
  :bp=/xxx/accounting/psbanner.pl
  :fx=flpdv
  :generate_banner
  :if=/hawktmp/ifhp-3.3.17/src/ifhp -Tpjl@,status@,sync@,pagecount@,ps_eoj_at_start@
  :ifhp=model=psbanner
  :lp=spb%9100
  :of=/hawktmp/ifhp-3.3.17/src/ifhp -Tstatus,sync@,pagecount,ps_eoj_at_start@
  :ps=status
  :sd=/var/spool/lpd/%P
  :sh@

and the output is now (when you do 'lpr /tmp/test') is:

%-12345X@PJL
@PJL JOB NAME = "PID 9015" DISPLAY = "ThisName"
@PJL RDYMSG DISPLAY = "ThisName Job Name:Lp"
@PJL USTATUSOFF
@PJL USTATUS JOB = ON
@PJL USTATUS DEVICE = ON
@PJL USTATUS PAGE = ON
@PJL USTATUS TIMED = 10
@PJL ENTER LANGUAGE = POSTSCRIPT
%!

20 dict begin
/bline true def
/user (ThisName) def
/job (Job Name) def
/file (/tmp/test) def
/host (h4) def
/date (Thu Jul 13 13:45:51 PDT 2000) def
/printer (t1) def
%
% Bannerpage and bannerline postscript code
%
/mm { 25.4 div 72 mul } def
/ef1 /Helvetica findfont [9 0 0 6 0 0] makefont def
/ef2 /Courier   findfont [9 0 0 6 0 0] makefont def
bline { %if
  /mbline {
    gsave
    initgraphics
    90 rotate
    //ef1 setfont  32 //mm exec -8 //mm exec moveto (User: ) show
          //ef2 setfont //user show
    //ef1 setfont 112 //mm exec -8 //mm exec moveto (File: ) show
          //ef2 setfont //file show
    //ef1 setfont 192 //mm exec -8 //mm exec moveto (Date: ) show
          //ef2 setfont //date show
    //ef2 setfont 112 //mm exec -6 //mm exec moveto (Printed at ) show
          //ef1 setfont (DIKU) show
    grestore
  } bind def
} { /mbline { } def } ifelse
<< /EndPage { 2 ne dup { //mbline exec } if exch pop } bind >> setpagedevice
end
%!PS-Adobe-3.0
%% one page (i.e. - a page with a 1 on it)
%%/Times-Roman
/Courier
findfont 200 scalefont setfont
72 300 moveto
(1) show
showpage
%-12345X@PJL
@PJL RDYMSG DISPLAY = "ThisName Job Name:Lp"
@PJL EOJ NAME = "PID 9015"
@PJL USTATUSOFF
@PJL USTATUS JOB = ON
@PJL USTATUS DEVICE = ON
@PJL USTATUS PAGE = ON
@PJL USTATUS TIMED = 10
@PJL RDYMSG DISPLAY = ""
%-12345X

This will print the 'bannerline' on each page.

Enjoy.


Patrick Powell                 Astart Technologies,
[EMAIL PROTECTED]            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   858-874-6543 FAX 858-279-8424 
LPRng - Print Spooler (http://www.astart.com)

-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to