LPR sample code README

This package explains the LPR sample code provided for use with InfoPrint
Manager for AIX, InfoPrint Manager for Windows, InfoPrint Manager for Linux
or Ricoh ProcessDirector.
##***************************************************************************/
##                                                                          */
##  Licensed Materials - Property of Ricoh Company, Ltd.                    */
##                                                                          */
##    Copyright Ricoh Company, Ltd. 1997-2021.                             */
##    All rights reserved.                                                  */
##                                                                          */
##    NOTE: This program sample is provided on an as-is basis and no support*/
##    or maintenance will be provided with respect to this program sample.  */
##    The licensee of the product is free to copy, revise, modify, and make */
##    derivative works of this program sample as they see fit.              */
##    The licensee of this sample code may not resell this code or include  */
##    it in a product that is resold.                                       */
##                                                                          */
##***************************************************************************/

## **********************************************************************/
##                                                                      */
##   THIS PROGRAM IS NOT SUPPORTED IN ANY WAY BY RICOH COMPANY Ltd.     */
##   IT HAS NOT BEEN SUBJECTED TO ANY                                   */
##   FORMAL TESTING AND IS DISTRIBUTED ON AN "AS-IS" BASIS              */
##   WITHOUT ANY WARRANTY EITHER EXPRESSED OR IMPLIED.                  */
##   THE USE OF THIS CODE OR ANY INFORMATION OR TECHNIQUES              */
##   IMPLICIT WITHIN IT IS THE SOLE RESPONSIBILITY OF THE               */
##   CUSTOMER. SUCH USE DEPENDS UPON THE CUSTOMER'S ABILITY TO          */
##   EVALUATE THE INFORMATION IN THE CONTEXT OF THEIR OWN               */
##   PARTICULAR OPERATING ENVIRONMENT.  THIS CODE HAS                   */
##   OPERATED SUCCESSFULLY IN THE COMPUTING ENVIRONMENT AT              */
##   THE BOULDER PROGRAMMING CENTER.  THERE IS NO                       */
##   GUARANTEE THAT IT WILL OPERATE CORRECTLY ELSEWHERE.                */
##                                                                      */
## **********************************************************************/

PURPOSE OF THIS PROGRAM SAMPLE:
-------------------------------
  This program sample provides a way for UNIX (non-AIX or non-RISC 
  System/6000), Linux and Windows customers to submit remote print jobs to an
  InfoPrint Manager or Ricoh ProcessDirector system with optional
  parameters using the -o flag. These remote print jobs can be sent from
  a UNIX system, a Linux system or a Windows system to InfoPrint Manager for AIX,
  InfoPrint Manager for Windows, InfoPrint Manager for Linux or Ricoh
  ProcessDirector. The -o flags that are interpreted by InfoPrint Manager
  and Ricoh ProcessDirector can be sent with the remote print job.

  On UNIX and Linux systems, this sample code allows you to submit a job 
  using a shell script we provide called LPR. If you invoke LPR with the 
  -A flag, the "lprafp" program we provide is used.  The lprafp program
  allows you to pass -o parameters to InfoPrint.  If you invoke LPR 
  without the -A flag, your standard print command will be used.

  On Windows systems, lprafp is invoked directly.

  This package includes both source code and compiled executables
  for the AIX, Windows and Linux for 32 and 64 bit platforms. You can
  either use the executables for these platforms as it is or you can modify
  the source code as necessary and compile it yourself. If you want to use 
  the client on a different platform, you must compile the source 
  yourself.

FILES INCLUDED IN THIS PROGRAM SAMPLE:
--------------------------------------
  Makefile                             - used by the make facility to generate the executable

  COPYING                              - license file
  INSTALL                              - instalation instructions
  README                               - this file
  RSLA for lprafp.txt                  - software license agreement
  RSLA for lprafp.pdf                  - software license agreement
  License Information for lprafp.txt   - license information
  License Information for lprafp.pdf   - license information

  inc/                                 - includes directory
  src/                                 - sources directory (IPv6 enabled by default on AIX, Linux and
                                         Windows)

  aix_linux/                           - build area for AIX and LINUX operating systems
  dec/                                 - Makefile for DEC operating system
  hpux/                                - Makefile for HPUX operating system
  solaris/                             - Makefile for SUN SOLARIS operating system
  windows/                             - Microsoft Windows Visual Studio C++ 2017 Folder project

  bin/LPR                              - shell script that invokes the system print command
                                         when the -A flag is not issued or the lprafp executable
                                         when the -A flag is issued
  bin/32/lprafp                        - AIX 32-bit executable (IPv6 enabled)
  bin/32/lprafp.exe                    - Microsoft Windows 32-bit executable (IPv6 enabled)
  bin/32/lprafp.linux.i386             - Linux 32-bit executable (IPv6 enabled, copy as lprafp to use)
  bin/32/lprafp.solaris.9              - SunOS 5.9 32-bit executable (copy as lprafp to use)
  bin/64/lprafp                        - AIX 64-bit executable (IPv6 enabled)
  bin/64/lprafp.exe                    - Microsoft Windows 64-bit executable (IPv6 enabled)
  bin/64/lprafp.linux.x86_64           - Linux 64-bit executable (IPv6 enabled, copy as lprafp to use)


SAMPLE SOURCE CODE HAS RUN SUCCESSFULLY ON THE FOLLOWING SYSTEMS:
-----------------------------------------------------------------
   AIX 7.1, 7.2
   HP, HP-UX
   Sun, SunOS 5.1.1
   Sun, Solaris 1.1.1
   DEC, ULTRIX V4.3A
   Windows 10, Server 2012 R2, Server 2016, Server 2019
   Linux SLES 12, 15
   Linux RHEL 6, 7, 8
   Linux CentOS 6, 7, 8

EXAMPLES:
---------

  1) To print two copies of /etc/motd without a trailer page on
     a logical printer named "laser" on server "alexandria":

        LPR -A -ocopies=2 -otrailer=no -s alexandria -p laser /etc/motd

  2) To set up environment so that subsequent print requests are sent
     to the logical printer named "laser" on server "alexandria":
     (Note that server can be in dotted address format; for example 9.99.9.99)

        LPR_PRINTER=laser
        export LPR_PRINTER
        LPR_SERVER=alexandria
        export LPR_SERVER

     To test that your environment variables have been set correctly:
        LPR -A /etc/motd 

   3) To print a file /etc/motd to the standard local print command 
      do not use the -A flag:

        LPR /etc/motd

   4) To print a file c:\autoexec.bat to a logical printer named "laser" on
      server "alexandria": (Note that the server can be in dotted address
      format; for example 9.99.9.99)

        lprafp -s alexandria -p laser c:\autoexec.bat

lprafp USAGE statement:
-----------------------
If you type "LPR -A -?" at a Linux or UNIX command prompt or lprafp -? 
at a Windows command prompt, the lprafp program is invoked and the
following usage statement is displayed.  If you type "LPR -?" at an AIX 
command prompt, the system print command is invoked and its usage 
statement is displayed.  

Usage: 
  lprafp [-n] [-o<option>] [-r<retries>] [-q<delay>] 
         [-p<printer>] [-s<server>] <files>

        files   - Files to be sent to the server
                  Global file characters are accepted

        Options -
                -?          Display this message
                -n          Display Error messages only
                -o<option>  used to specify InfoPrint options
                            (example:  -oformdef=F1SAMPLE)
                -r<retries> Sets the number of retries
                            Default = 3 retries
                -q<delay>   Sets retry delay in seconds
                            Default = 10 seconds
                -p<printer> Specifies logical printer on the InfoPrint server
                            Defaults to the LPR_PRINTER environment variable
                -s<server>  Specifies the InfoPrint server
                            Defaults to the LPR_SERVER environment variable

lprafp Return Codes:
--------------------
Additionally to displaying the error messages, lprafp returns the following codes:
                100 - lprafp command line error/missusage of lprafp/file not found or is 0 bytes in length
                111 - lprafp communication error with the Line Priter Daemon
                1   - Error code received from LPD: Server cannot open or write to printer
                2   - Error code received from LPD: Out of storage space
                33  - other error code received from LPD