Printer banners

EEA index

MDFS
Description
Hardware
Error codes
Accessing
Users file
Print banners

Intro
FileStore
Others
Clocks
Bridges
Interfaces
Misc h/w
Testing
Misc info

Printer banners

The MDFS server allows you to add printer banners to data printed from it.

This is only really suitable for text-only printouts. If anything else is to be sent, such as a raster image to a LaserJet, then banners should not be used).
However... It is possible to have multiple printer definitions referring to the same printer, with different banners. For example, on my server the printers defined are:

   Printer #1   MDFS   [Default]
                Spooling, to Parallel, no banner
                Anonymous users allowed to print

   Printer #2   Hold
                Output held
                Anonymous users allowed to print

   Printer #3   UsrPrn
                Spooling, to Parallel, banner
                Anonymous users allowed to print
The printer connected to Parallel is an EPSON GQ-5000 LaserJet. If I want to print raster images (such as something printed from RISC OS), I send it to "MDFS". If I just want to dump out some plain text, I can send it to "MDFS" for no header or to "UsrPrn" to be given a header.

 

Where banners are stored

Under version 2.00 of the MDFS code, it is possible to set up banners very easily. Simply create a directory in the root of the main (lowest numbered) disc partition, called "BANNERS". Within this directory, create a banner file and save it with the same name as the printer that it applies to.
For example, my system is set up as:
   $
   |
   '-- banners
       |
       '-- usrprn
There is only the one file as only the one printer has a banner. If I wanted a banner for the "MDFS" printer, I'd create it and save it as "$.banners.mdfs".

 

Writing a banner

You should use something like !Edit to create your banners. If you are using a BBC micro, you can use WordWise provided you don't embed control functions in the document.
Failing all of that, you can write a short BASIC program to open the file and BPUT# the required information.

The banner mechanism allows you to print information at the top of the output and append something to the bottom of it. You can include printer control codes, for example two banners relating to the same printer, one called "draft", the other called "nlq", with the banners selecting the output style for the subsequent output.

 

Banner file format

The format of the banner file is simple:
end text<BANNER>banner text
Yes, the stuff to be printed last comes first!

We shall look at my banner as an example:

[0c]<BANNER>[0d]********************************************************[0d]
<MARK>* Printer "UsrPrn" on MDFS server 2.254<TAB 56>*[0d]
<MARK>* Username   : <USERNAME><TAB 56>*[0d]
<MARK>* Station ID : <STATION><TAB 56>*[0d]
<MARK>* <START>Submitted  : <DATE><ST> <MONTHNAME> 19<YEAR>, <H>:<M>:<S><TAB 56>*[0d]
<MARK>* <NOW>Printed    : <DATE><ST> <MONTHNAME> 19<YEAR>, <H>:<M>:<S><TAB 56>*[0d]
********************************************************[0d]
[0d]
This is formatted as it would be seen in !Edit.
The first character, [0c] is ASCII character 12. This forces a form feed, so the printer ejects the page rather than waiting for more input.
Next is the <BANNER> code, which says that the ending text is finished, the remainder is to be put before the actual printed text.

When printed, it looks something like:

********************************************************
* Printer "UserPrn" on MDFS server 2.254               *
* Username   : SYST                                    *
* Station ID : 001.252                                 *
* Submitted  : 28th June 1999, 12:57:42                *
* Printed    : 28th June 1999, 12:57:42                *
********************************************************

| !Run file for BudgieSoft VideoList   <-- This is the file being
|                                          printed, not the banner!
%Set VideoList$Dir <Obey$Dir>
%IconSprites <VideoList$Dir>.!Sprites
|

[et cetera...]

 

Banner codes

The following codes are available:
  • <HOURS>
    Gives a two-digit hour in the 24hr clock, with leading zero. For example, 6pm would be printed as "18".
  • <H>
    Short form of HOURS.
  • <MINUTES>
    Gives the minutes past the hour in the range 00 to 59, with leading zero.
  • <M>
    Short form of MINUTES.
  • <SECONDS>
    Gives the seconds past the minute in the range 00 to 59, with leading zero.
  • <S>
    Short form of SECONDS.
  • <12HOURS>
    Gives the hour in the 12hr clock, with leading zero replaced by a space, so 6pm would be printed as " 6".
  • <AM>
    Gives 'am' or 'pm' as appropriate. Noon is considered 'pm'.
  • <DATE>
    The day of the month, two digits, with leading zero replaced by a space.
  • <ST>
    Gives correct suffix for day of month; for example 1st, 2nd, 3rd, 4th et cetera.
  • <MONTHNAME>
    Gives the full name of the month (ie, "December"). No leading spaces are printed.
  • <MTH>
    Gives three-letter abbreviation for the month, in lower case. For example, "December" is printed as "dec".
  • <MONTH>
    Gives month as a number in range 01 to 12, with leading zero.
  • <YEAR>
    Gives the last two digits of the year.
    My banner file said "19<YEAR>" so it would have required modification after the millennium.
  • <USERNAME>
    Gives the name of the user that submitted the print job. No leading spaces are printed.
  • <STATION>
    Gives the number of the station that submitted the print job. The network and station numbers are printed with leading zeros; with the exception of stations on the network local to the server which have the network number omitted. No leading spaces are given in this case.
    For example, server is 2.254:
    From 1.252, it would output "001.252"
    From 2.96, it would output "096"
  • <BANNER>
    The delimiter between the end text and the banner text.
    If you have no end text, begin the file with this code.
    I suggest you put a Form Feed to be given at the end of the file, thus forcing a page throw as rather a lot of older software doesn't do this.
    This command does not cause anything to be printed directly.
  • <B>
    Short form of BANNER.
  • <MARK>
    A reference point for TAB (see below).
    This command does not cause anything to be printed directly.
  • <TAB xxx>
    Pads out to a position xxx spaces from the last MARK; or xxx spaces from the beginning of the text if no MARK was issued. Be aware that a newline does not reset the pointer, so it is best to insert a MARK at the beginning of each line that makes use of TAB.
    There must be only one space between 'TAB' and the number.
    "<TAB 0>" is illegal, and will be printed exactly as that - "<TAB 0>"!
  • <NOW>
    Sets the time variables to the moment when printing is actually taking place.
    Note that two NOWs (such as one in the banner and one in the end text) may store different times as time may have elapsed between.
    This command does not cause anything to be printed directly.
  • <START>
    Sets the time variables to the moment at which the printing was initiated, from the user's computer; which is the default value of the time variables.
    Note that when print spooling is used, this (and END below) may be substantially earlier than the time given by NOW.
    This command does not cause anything to be printed directly.
  • <END>
    Sets the time variables to the moment that user finished sending characters to the printer.
    This command does not cause anything to be printed directly.

 

Including control codes

You can include control codes in the file either directly (if your editor supports this), or by use of the '|' character.
| introduces a 'control' character, for example |L inserts a <ctrl-L>, which is a Form Feed.
|? inserts ASCII character &7F (delete).
|! inserts the following character with &80 added (top bit set).
|< inserts '<'
|> inserts '>'
|| inserts '|'
Control code table:
    0   |@     27   |[
    1   |A     28   |\
    2   |B     29   |]
    3   |C     31   |^
    4   |D     31   |_
    5   |E
    6   |F    ...
    7   |G
    8   |H     60   |<
    9   |I     ..
   10   |J     62   |>
   11   |K
   12   |L    ...
   13   |M
   14   |N    124   ||
   15   |O     
   16   |P    ...
   17   |Q
   18   |R    127   |?
   19   |S    128   |!|@
   20   |T    129   |!|A
   21   |U    
   22   |V    ... etc...
   23   |W
   24   |X    254   |!|~
   25   |Y    255   |!|?
   26   |Z
Using the table above, my banner could be rewritten as (this is ALL on one line, split here for formatting purposes only):
|L<BANNER>|M********************************************************
********************|M|J<MARK>* Printer "UsrPrn" on MDFS server 2.25
4<TAB 76>*|M|J<MARK>* Username   : <USERNAME><TAB 76>*|M|J<MARK>* St
ation ID : <STATION><TAB 76>*|M|J<MARK>* <START>Submitted  : <DATE><
ST> <MONTHNAME> 19<YEAR>, <H>:<M>:<S><TAB 76>*|M|J<MARK>* <NOW>Print
ed    : <DATE><ST> <MONTHNAME> 19<YEAR>, <H>:<M>:<S><TAB 76>*|M|J***
********************************************************************
*****|M|J|M|J


Copyright © 2008 Rick Murray