

echo
echo
echo "A series of questions will be asked in order to create a file containing"
echo "Document Option Commands. This file will be sent before every job sent to"
echo "the queue being configured.  Therefore the user can create logical queues"
echo "for the same printer that will automatically format the output according"
echo "to the DOC file for the specified queue."
echo
echo
echo "Would you like to customize a logical queue (yes/no)? [no]"
read REPLY
case $REPLY in 
   YES|yes|Y|y)
    echo "%!" > $PREPROLOGUE
    echo
    echo "Do you want to add multiple copies (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
       echo "How many copies?"
       read COPIES
       if [ "$COPIES" -gt 1 ]
       then
        echo "%%IncludeFeature: numcopies ( $COPIES )" >> $PREPROLOGUE
       fi 
    ;;
    esac
    echo
    echo "Do you want to add duplex (yes/no)? [no]" 
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
      echo "%%IncludeFeature: duplex" >> $PREPROLOGUE
    ;;

    *) 
         echo
         echo "Do you want to disable duplex (yes/no)? [no]"
         read REPLY
         case $REPLY in 
         YES|yes|Y|y) 
             echo "%%IncludeFeature: duplex ( off )" >> $PREPROLOGUE
         ;;  
         esac 
    ;;
    esac
    echo
    echo "Do you want to add tumble (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
        echo "%%IncludeFeature: duplex ( tumble )" >> $PREPROLOGUE
    ;;  
    esac 

    echo
    echo "Do you want to force a language (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
	echo
        echo "Enter the desired language."
        echo "		postscript	pcl4		pcl5"      
        echo "		hpgl		ln03+		lineprinter" 
        echo "		ultrascript	ccitt"
        read LANGUAGE
        echo "%%IncludeFeature: emulation ( $LANGUAGE )" >> $PREPROLOGUE


        case $LANGUAGE in

             hpgl)
    		    echo
                    echo "Would you like to define options for use with HPGL (yes/no)? [no]"
                    read REPLY
                    case $REPLY in 
                    YES|yes|Y|y)
			 echo
                         echo "Would you like to define a specific model of HP-GL Plotter to be used (yes/no)? [no]"
                         read IN_REPLY
                         case $IN_REPLY in
                         YES|yes|Y|y)
                              echo "Enter the your choice of plotters."
                              echo "Choices are:"
                              echo "                 7470A        7475A"
                              echo "                 colorpro     7550A"
                              read PLOTTER
                              echo "%%IncludeFeature: plotter ( $PLOTTER )" >> $PREPROLOGUE
                          ;;
                          esac
			  echo
                          echo "Would you like to scale your image (yes/no)? [no]"
                          read IN_REPLY
                          case $IN_REPLY in
                          YES|yes|Y|y)
                              echo "Enter the percentage in which to scale the image (1-150)."
                              read SCALE_FACT 
                              echo "%%IncludeFeature: scaling ( $SCALE_FACT )" >> $PREPROLOGUE
                          ;;
                          esac

		          echo
                          echo "Would you like to select the document's original paper type (yes/no)? [no]"
                          read IN_REPLY
                          case $IN_REPLY in
                          YES|yes|Y|y)
                              echo "Enter the paper type."
                              echo "Choices are                 Letter      A4"
                              echo "                            Ledger      A3"
                              echo "                            Scale (to scale image to papertype in current inputbin)"
                              read SETTING
                              echo "%%IncludeFeature: originalpaper ( $SETTING )" >> $PREPROLOGUE
                          ;;
                          esac

			  echo
                          echo "Would you like to select the image's offset from the plotter's origin (yes/no)? [no]"
                          read IN_REPLY
                          case $IN_REPLY in
                          YES|yes|Y|y)
                              echo "Enter the X offset in hundredths of an inch."
                              read X_OFF
                              echo "Enter the Y offset in hundredths of an inch."
                              read Y_OFF
                              echo "%%IncludeFeature: origin ( $X_OFF $Y_OFF )" >> $PREPROLOGUE
                          ;;
                          esac

			  echo
                          echo "Would you like to print the inverse of the image (yes/no)? [default]"
                          read IN_REPLY
                          case $IN_REPLY in
                          YES|yes|Y|y)
                              echo "%%IncludeFeature: reverse ( on )" >> $PREPROLOGUE
                          ;;
                          NO|no|N|n)
                              echo "%%IncludeFeature: reverse ( off )" >> $PREPROLOGUE
                          ;;
                          esac

			  echo
                          echo "Would you like to turn expand mode on or off (on/off)? [default]"
                          read IN_REPLY
                          case $IN_REPLY in
                          ON|on)
                              echo "%%IncludeFeature: expand ( on )" >> $PREPROLOGUE
                          ;;
                          OFF|off)
                              echo "%%IncludeFeature: expand ( off )" >> $PREPROLOGUE
                          ;;
                          esac

                          limit=8
                          while test $limit -gt 0
                          do
			       echo
                               echo "Would you like to define pen width and color (yes/no)? [no]"
                               echo "You can define up to $limit."
                               read IN_REPLY
                               case $IN_REPLY in
                               YES|yes|Y|y)
                                   echo "Enter the pen number."
                                   read PEN_NUM
                                   echo "Enter the pen width."
                                   read PEN_WIDTH
                                   echo "Enter the pen color."
                                   read PEN_COLOR
                                   echo "%%IncludeFeature: pen ( $PEN_NUM $PEN_WIDTH $PEN_COLOR )" >> $PREPROLOGUE
                                   limit=`expr $limit - 1`
                               ;;
                               *)
                                   limit=0 
                               ;;
                               esac
                           done
                    ;;
                    esac
             ;; 
             pcl4|pcl5)
		    echo
                    echo "Would you like to define options for use with PCL (yes/no)? [no]" 
                    read REPLY
                    case $REPLY in 
                    YES|yes|Y|y)
			 echo
                         echo "Would you like to select a default font (yes/no)? [no]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
                              echo "Enter the default font."
			      echo
			      echo "For printers that support HP-PCL4, your choices are: "
                              echo "	courier10         courier10bold"
                              echo "	courier10italic   courier12"
                              echo "	courier12bold     courier12italic"
                              echo "	lineprinter"
			      echo 
			      echo "If your printer supports HP-PCL5, your choices also include:"
			      echo "	times*			times*italic		times*bold"
			      echo "	times*blditalic		univ*			univ*italic"
			      echo "	univ*bold		univ*bolditalic		univcond*"
			      echo "	univcond*italic		univcond*bold		univcond*blditlc"
			      echo "	selectbyid"	
                              read SETTING
                              echo "%%IncludeFeature: font ( $SETTING )" >> $PREPROLOGUE
			 ;;
			 esac
			 case $SETTING in
			 selectbyid)
			      echo
			      echo "Would you like to specify a default font id (yes/no)? [no]"
			      read REPLY
                              case $REPLY in
                              YES|yes|Y|y) 
				echo "Enter the font ID."
                                read SETTING
                                echo "%%IncludeFeature: fontid( $SETTING )" >> $PREPROLOGUE
			      ;;
			      esac
                         ;;
                         esac

			 echo
                         echo "Would you like to select a specific symbol set (yes/no)? [no]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
                              echo "Enter the symbol set name."
			      echo
			      echo "For printers that support HP-PCL4, your choices are: "
                              echo "	roman-8     pc-850    pc8-us    pc8-dn" 
                              echo "	ecma-94     german    spanish   is0-2"
                              echo "	iso-4       iso-6     iso-10    iso-11"
                              echo "	iso-14      iso-15    iso-16    iso-17"
                              echo "	iso-21      iso-25    iso-57    iso-60"
                              echo "	iso-61      iso-69    iso-84    iso-85"
			      echo
			      echo "If your printer supports HP-PCL5, your choices also include:"
			      echo "	hpgerman	hpspanish	legal		desktop	"
			      echo "	ps-math 	math-8		microsoft-pub	pi-font"
			      echo "	ps-text		ventura-intl	ventura-math	ventura-us"
			      echo "	windows		ps-zapf-dingbats		ventura-dingbats"
			      echo "	zapf-dingbats100		zapfdingbats200"
			      echo "	zapf-dingbats300"	
                              read SETTING
                              echo "%%IncludeFeature: symbolset ( $SETTING )" >> $PREPROLOGUE
                         ;;
                         esac

			 echo
			 echo "If your printer supports HP-PCL5, would you like to specify a"
			 echo "pointsize for the default font (yes/no)? [no]"
			 read REPLY
			 case $REPLY in
			 YES|yes|Y|y)
			      echo "Enter the point size."
			      read SETTING
			      echo "%%IncludeFeature: pointsize ( $SETTING )" >> $PREPROLOGUE
			 ;;
			 esac
 
			 echo
                         echo "Would you like to define the number of lines per page (yes/no)? [no]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
                              echo "Enter the number of lines per page."
                              read SETTING
                              echo "%%IncludeFeature: linesperpage ( $SETTING )" >> $PREPROLOGUE
                         ;;
                         esac

			 echo
                         echo "Would you like to reset the emulation to its default state"
			 echo "after every job (yes/no)? [default]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
                              echo "%%IncludeFeature: reset ( on )" >> $PREPROLOGUE
                         ;;
                         NO|no|N|n)
                              echo "%%IncludeFeature: reset ( off )" >> $PREPROLOGUE
                         ;;
                         *)
                         ;;
                         esac

			 echo
			 echo "If your printer supports HP-PCL5, would you like the emulation to"
			 echo "retain temporary fonts, macros, and patterns in the printer's"
			 echo "memory after the end of a job (yes/no)? [no]"
			 read REPLY
			 case $REPLY in
			 YES|yes|Y|y)
				echo "%%IncludeFeature: retainTemporary( on )" >> $PREPROLOGUE
			 ;;
			 NO|no|N|n)
				echo "%%IncludeFeature: retainTemporary( off )" >> $PREPROLOGUE
			 ;;
			 *)
			 ;;
			 esac

			 echo
                         echo "Would you like to set line termination to LF=CR/LF (yes/no)? [no]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
                              echo "%%IncludeFeature: lfiscrlf ( on )" >> $PREPROLOGUE
                         ;;
                         NO|no|N|n)
                               echo "%%IncludeFeature: lfiscrlf ( off )" >> $PREPROLOGUE
                         ;;
                         esac

			 echo
                         echo "Would you like to set line termination to CR=CR/LF (yes/no)? [no]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
                              echo "%%IncludeFeature: criscrlf ( on )" >> $PREPROLOGUE
                         ;;
                         NO|no|N|n)
                               echo "%%IncludeFeature: criscrlf ( off )" >> $PREPROLOGUE
                         ;;
                         esac

			 echo
			 echo "Would you like to specify a SCSI disk as a resource for a font,"
			 echo "macro (HP-PCL5 only), or pattern (HP-PCL5 only) (yes/no)? [no]"
			 read REPLY
			 case $REPLY in
			 Yes|Y|yes|y)
				echo "Enter the SCSI disk's address (0-6)."
				read ADDRESS
				echo "Enter the ID for the font/macro/pattern." 
				read FONTID
				echo "%%IncludeFeature: resource( $ADDRESS $FONTID )" >> $PREPROLOGUE	
			 ;;
			 esac

                  ;;
                  esac
             ;;
             ln03+)


			 echo
                         echo "Would you like to define options for use with LN03 (yes/no)? [no]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
			      echo
                              echo "Would you like specify a specifc model of the LN03 printer (yes/no)? [default]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "Enter a model."
                                   echo "The choices are     LN03     LPQ102     LA100"
                                   read SETTING
                                   echo "%%IncludeFeature: product ( $SETTING )" >> $PREPROLOGUE
                              ;;
                              esac


			      echo
                              echo "Would you like to turn autowrap on or off (on/off)? [default]"
                              read REPLY
                              case $REPLY in
                              ON|on)
                                   echo "%%IncludeFeature: autowrap ( on )" >> $PREPROLOGUE
                              ;;
                              OFF|off)
                                   echo "%%IncludeFeature: autowrap ( off )" >> $PREPROLOGUE
                              ;;
                              esac

			      echo
                              echo "Would you like to set the page formatting options according to the"
			      echo "paper type (yes/no)? [default]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "Enter a paper type."
                                   echo "The choices are     Letter     A4     Legal"
                                   read SETTING
                                   echo "%%IncludeFeature: paper_size ( $SETTING )" >> $PREPROLOGUE
                              ;;
                              esac


			      echo
                              echo "Would you like margins to be affected by LN03 page selection"
			      echo "commands (yes/no)? [default]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "%%IncludeFeature: page_size_override ( on )" >> $PREPROLOGUE
                              ;;
                              NO|no|N|n)
                                   echo "%%IncludeFeature: page_size_override ( off )" >> $PREPROLOGUE
                              ;;
                              esac


			      echo
                              echo "Would you like to reset to the LN03+ defaults after every job (yes/no)? [default]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "%%IncludeFeature: reset_override ( on )" >> $PREPROLOGUE
                              ;;
                              NO|no|N|n)
                                   echo "%%IncludeFeature: reset_override ( off )" >> $PREPROLOGUE
                              ;;
                              esac

                         ;;
                         esac
             ;;
             lineprinter)

			 echo
                         echo "Would you like to define options for use with LINEPRINTER (yes/no)? [no]"
                         read REPLY
                         case $REPLY in
                         YES|yes|Y|y)
			      echo
                              echo "Would you like to set line termination to LF=CR/LF (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "%%IncludeFeature: lfiscrlf ( on )" >> $PREPROLOGUE
                              ;;
                              NO|no|N|n)
                                    echo "%%IncludeFeature: lfiscrlf ( off )" >> $PREPROLOGUE
                              ;;
                              esac

			      echo
                              echo "Would you like to set line termination to CR=CR/LF (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "%%IncludeFeature: criscrlf ( on )" >> $PREPROLOGUE
                              ;;
                              NO|no|N|n)
                                   echo "%%IncludeFeature: criscrlf ( off )" >> $PREPROLOGUE
                              ;;
                              esac


			      echo
                              echo "Would you like to define the number of lines per page (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "Enter the number of lines per page."
                                   read SETTING
                                   echo "%%IncludeFeature: linesperpage ( $SETTING )" >> $PREPROLOGUE
                              ;;
                              esac


			      echo
                              echo "Would you like to turn autowrap on or off (on/off)? [default]"
                              read REPLY
                              case $REPLY in
                              ON|on)
                                   echo "%%IncludeFeature: autowrap ( on )" >> $PREPROLOGUE
                              ;;
                              OFF|off)
                                   echo "%%IncludeFeature: autowrap ( off )" >> $PREPROLOGUE
                              ;;
                              esac



			      echo
                              echo "Would you like to specify a font to be used with the documents (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "Please enter a Postscript font."
                                   read SETTING
                                   echo "%%IncludeFeature: font ( $SETTING )" >> $PREPROLOGUE
                              ;;
                              esac

			      echo
                              echo "Would you like enter a point size for the font to be used (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "Please enter a point size."
                                   read VALUE
                                   echo "%%IncludeFeature: pointsize ( $VALUE )" >> $PREPROLOGUE
                              ;;
                              esac

			      echo
                              echo "Would you like to turn on line numbering (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "%%IncludeFeature: number ( on )" >> $PREPROLOGUE
                              ;;
                              NO|no|N|n)
                                   echo "%%IncludeFeature: number ( off )" >> $PREPROLOGUE
                              ;;
                              esac

			      echo
                              echo "Would you like to define your tab length (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "Please enter the number of space characters between tabstops."
                                   read VALUE
                                   echo "%%IncludeFeature: tabs ( $VALUE )" >> $PREPROLOGUE
                              ;;
                              esac

			      echo
                              echo "Would you like to specify the type of character map to be used (yes/no)? [no]"
                              read REPLY
                              case $REPLY in
                              YES|yes|Y|y)
                                   echo "Please enter ASCII or EBCDIC (in upper case)."
                                   read SETTING
                                   echo "%%IncludeFeature: map ( $SETTING )" >> $PREPROLOGUE
                              ;;
                              esac

                         ;;
                         esac
        ;;
        esac
    ;; 
    esac  

    echo
    echo "Do you wish to collate the output (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
        echo "%%IncludeFeature: collate" >> $PREPROLOGUE
    ;; 
    esac  
    echo
    echo "Do you want the output to go to a certain bin (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
          echo "Which bin do you prefer?"
          echo "                           1, 2, 3, *, <logical-name>"
          read WHERE
          echo "%%IncludeFeature: output ( $WHERE )" >> $PREPROLOGUE
    ;; 
    esac  
    echo
    echo "Do you want the Portrait mode enabled? (yes/no) [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
          echo "%%IncludeFeature: orientation ( Portrait )" >> $PREPROLOGUE
    ;; 
    esac  
    echo
    echo "Do want the Landscape mode enabled (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
          echo "%%IncludeFeature: orientation ( Landscape )" >> $PREPROLOGUE
    ;; 
    esac  
    echo
    echo "If you wish to change the logical page size mapped to the physical"
    echo "then enter Letter, Ledger, Legal, or Executive (beginning with a capital)," 
    echo "otherwise press ENTER."
    read PAGESIZE
    case $PAGESIZE in 
    Letter|Ledger|Legal|Executive) 
        echo "%%IncludeFeature: pagesize ( $PAGESIZE )" >> $PREPROLOGUE
    ;; 
    esac  
    echo
    echo "Would you like to select the physical size of the input paper (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
         echo "Choose between the following or <cr> for default."
         echo "               Letter            Ledger"
         echo "               Legal             Executive"
         echo "               A5                A4"
         echo "               A3                B5"
         echo "               B4"
    read TYPE
    TP=1 
    ;;
    *)
    TP=0
    ;; 
    esac  
    echo
    echo "Do you want to select the input bin (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
    echo "Please enter the desired input bin or <cr> for printers default."
    echo "Possible choices are:"
    echo "                      1, 2, 3, 4, "
    echo "                      manualfeed, *"
    echo "                      <logical-name>"
    read SOURCES
    IB=1
    ;;
    *)
    IB=0
    ;; 
    esac 
    if [ $TP -eq 1 -o $IB -eq 1 ] 
    then 
       echo "%%IncludeFeature: input ( $TYPE $SOURCES )" >> $PREPROLOGUE
    fi
    echo
    echo "Would you like the header on or off (on/off/default)? [default]"
    read HSET 
    case $HSET in 
    ON|on)
        HSET=on 
        echo
        echo "Would you like to specify an input source for the header (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
       echo "The choices are: "
         echo "               Letter            Ledger"
         echo "               Legal             Executive"
         echo "               A5                A4"
         echo "               A3                B5"
         echo "               B4"
    read HSOURCE
    echo "%%IncludeFeature: header ( $HSET $HSOURCE )" >> $PREPROLOGUE
    ;; 
    *)
    echo "%%IncludeFeature: header ( $HSET )" >> $PREPROLOGUE
    ;;
    esac  
   ;; 
   OFF|off)
    HSET=off
    echo "%%IncludeFeature: header ( $HSET )" >> $PREPROLOGUE
   ;;
   esac  

    echo
    echo "Would you like the trailer on or off (on/off/default)? [default]"
    read TSET 
    case $TSET in 
    ON|on)
        TSET=on 
        echo
        echo "Would you like to specify an input source for the trailer (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y) 
       echo "The choices are: "
         echo "               Letter            Ledger"
         echo "               Legal             Executive"
         echo "               A5                A4"
         echo "               A3                B5"
         echo "               B4"
    read TSOURCE
    echo "%%IncludeFeature: trailer ( $TSET $TSOURCE )" >> $PREPROLOGUE
    ;; 
    *)
    echo "%%IncludeFeature: trailer ( $TSET )" >> $PREPROLOGUE
    ;; 
    esac
    ;;
    OFF|off)
        TSET=off
        echo "%%IncludeFeature: trailer ( $TSET )" >> $PREPROLOGUE
    ;; 
    esac  


    echo
    echo "Would you like to map multiple pages of the document on one physical page (Yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y)
          echo "Enter the number of columns of pages per sheet (1-10)."
          read PAGE_COL
          echo "Enter the number of rows of pages per sheet (1-10)."
          read PAGE_ROW
          echo "Enter the distance between two consecutive columns (1/7200 in)."
          read COL_SPACE
          echo "Enter the distance between two consecutive rows (1/7200 in)."
          read ROW_SPACE
          echo "Enter the order in which the pages are mapped to the physical page."
          echo "      The choices are:       rightdown       leftdown"
          echo "                             rightup         leftup"
          echo "                             downright       downleft"
          echo "                             upright         upleft"
          read PAGE_ORDER
          
          echo "%%IncludeFeature: pagegrid ( $PAGE_COL $PAGE_ROW $COL_SPACE $ROW_SPACE $PAGE_ORDER )" >> $PREPROLOGUE
    ;; 
    esac  


    echo
    echo "Would you like to specify margins for the physical sheet of paper (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y)
         echo "Enter the value of the left margin in centipoints (1/7200 in)"
         read LEFT
         echo "Enter the value of the right margin in centipoints(1/7200 in)"
         read RIGHT
         echo "Enter the value of the top margin in centipoints (1/7200 in)"
         read TOP 
         echo "Enter the value of the bottom margin in centipoints (1/7200 in)"
         read BOTTOM
         echo "Would you like to alternate the margins on every other sheet (yes/no)? [no]"
         read IN_REPLY
         case $IN_REPLY in
         YES|yes|Y|y)
              echo "Exchange left and right margins (yes/no)? [no]"
              read IN_REPLY
              case $IN_REPLY in 
              YES|yes|Y|y) 
                  ALTER=left
              ;; 
              NO|no|N|n)
              echo "Setting alternate to exchange top and bottom margins."
                  ALTER=top
              ;;
              esac  
              echo "%%IncludeFeature: margins ( $LEFT $TOP $RIGHT $BOTTOM $ALTER )" >> $PREPROLOGUE
         ;;
         *)
              ALTER=off
              echo "%%IncludeFeature: margins ( $LEFT $TOP $RIGHT $BOTTOM $ALTER )" >> $PREPROLOGUE 
         ;;
         esac
    ;; 
    esac  


    echo
    echo "Would you like to specify a page offset (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y)
          echo "Enter the left offset in centipoints (1/7200 in)"
          read LEFT
          echo "Enter the top offset in centipoints (1/7200 in)"
          read TOP
          echo "%%IncludeFeature: pageoffset ( $LEFT $TOP )" >> $PREPROLOGUE
    ;; 
    esac  

    echo
    echo "Do you want to include a border around your logical page (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y)
          echo "Enter the width of the border in centipoints (1/7200 in)"
          read WIDTH 
          echo "%%IncludeFeature: border ( $WIDTH  )" >> $PREPROLOGUE
    ;; 
    esac 
 
    echo
    echo "Would you like to turn page scaling on or off (on/off)? [default]"
    read REPLY
    case $REPLY in 
    ON|on)
          echo "%%IncludeFeature: pagescaling ( on )" >> $PREPROLOGUE
    ;;
    OFF|off)
          echo "%%IncludeFeature: pagescaling ( off )" >> $PREPROLOGUE
    ;;
    esac

    echo
    echo "Would you like to enter a printer resolution (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y)
       echo "Enter the desired resolution."
       read RES
          echo "%%IncludeFeature: resolution ( $RES )" >> $PREPROLOGUE
    ;;
    esac
    echo
    echo "Would you like your output in a booklet format (yes/no)? [no]"
    read REPLY
    case $REPLY in 
    YES|yes|Y|y)
          echo "Enter the number of pieces of paper you want to use for the booklet."
          read NUMOPAGES
          echo "Do you want the fold to be horizontal (yes/no)? [no]"
          read REPLY
          case $REPLY in 
          YES|yes|Y|y)
              FOLD=horizontal
          ;;
          *)
              echo "Setting the fold to be vertical."
              echo " "
              FOLD=vertical
          ;;
          esac
          echo "Enter the value for the inner margin in centipoints (1/7200 in)"
          read INNER
          echo "Enter the thickness of the paper being used (1/10,000 in)"
          read THICK
          echo "%%IncludeFeature: booklet ( $NUMOPAGES $FOLD $INNER $THICK )" >> $PREPROLOGUE
    ;;
    esac
  echo
  echo "Would you like to include your own Document Option Command (yes/no)? [no]"
  read REPLY
  case $REPLY in 
  YES|yes|Y|y)
    echo "Input the string you wish to include."
    read STRING 
    echo $STRING >> $PREPROLOGUE
  ;; 
  esac  

;;
esac
