home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / print / print160.arj / PRINT160.DOC next >
Text File  |  1991-07-22  |  14KB  |  394 lines

  1.  
  2.  
  3.  
  4.       PRINT160
  5.  
  6.       160 Column print program
  7.  
  8.  
  9.         S.T.Ellis
  10.  
  11.     20 July 1991
  12.  
  13.  
  14.  
  15. 1. OVERVIEW
  16. -----------
  17.  
  18. PRINT160 was originally written to conserve paper by squeezing
  19. more text onto each sheet of printer paper. This is achieved by
  20. setting the printer into a condensed subcript mode and printing
  21. two columns of text on a page. This allows an effective paper size
  22. of 78 characters per line, 200 lines per page for standard listing
  23. paper, or 214 lines per page on A4. Different column widths can be
  24. set, as well as tabs, margins, and central dividers. In addition,
  25. a number of EPSON print formatting commands have been supported so
  26. that the compact version of your document will look as similar as
  27. possible to the larger one.
  28.  
  29.  
  30. 2. USAGE
  31. --------
  32.  
  33. To use PRINT160 you will need an EPSON-compatible printer. Most
  34. printers for the PC conform to the Epson control code standard to
  35. some degree, so this should not be too much of a problem.
  36.  
  37. In its simplest form, the program is started from the command
  38. line, with a list of files to be printed. Eg:
  39.  
  40. C> PRINT160 FILE1.DOC FILE2.DOC
  41.  
  42. This will print out FILE1.DOC and FILE2.DOC on the printer. At
  43. the top of each page is a header showing the date and time that
  44. printing of the file started, the filename that you supplied, and
  45. the page number. Below this is the text of your file, separated
  46. into two columns by a vertical bar character. Note that the text
  47. will stretch from one edge of the paper to the other.
  48.  
  49. It is often useful, when filing listings, to punch the left hand
  50. edge of the paper, and so a left margin may be useful. Specifying
  51. a "-m" option on the command line gives a 6-character margin:
  52.  
  53. C> PRINT160 -m FILE1.DOC
  54.  
  55. Note that you can use a '/' character instead of the '-' sign,
  56. which will probably be familiar. The above example could
  57. therefore have been written:
  58.  
  59. C> PRINT160 /m FILE1.DOC
  60.  
  61. If you want a different margin, you can specify a number after
  62. the m from 0 to 99. For a twelve character margin type:
  63.  
  64. C> PRINT160 -m12 FILE1.DOC
  65.  
  66. The margin may be up to 99 characters wide.
  67.  
  68. Tab stops are set at 8 character intervals, except for files with
  69. an extension of .C, where the interval is 4 characters, and .S
  70. files which have a 12 character tab. You can override this
  71. default using the -t option, which works in much the same way as
  72. the -m option above. For example
  73.  
  74. C> PRINT160 -t8 FILE1.C
  75.  
  76. Will print FILE1.C with 8 character tabs. If you do not specify a
  77. number after the -t option, 8 character tabs are assumed. So the
  78. above example could also have been written:
  79.  
  80. C> PRINT160 -t FILE1.C
  81.  
  82. Tab widths may be up to 16 characters.
  83.  
  84. You can combine several options together by just typing them all
  85. after the initial minus sign. So for a twelve character tab and a
  86. margin of 10 characters,
  87.  
  88. C> PRINT160 -t12m10 FILE1.DOC
  89.  
  90. or
  91.  
  92. C> PRINT160 -t12 -m10 FILE1.DOC
  93.  
  94. You can supply different options for each file, simply by
  95. preceding each filename by the options it requires. Any options
  96. not resepecified since the previous file will stay the same. So,
  97.  
  98. C> PRINT160 -t12m10 FILE1.DOC -m FILE2.DOC -t FILE3.DOC
  99.  
  100. Will print FILE1.DOC with 12 character tabs and a 10 character
  101. margin, followed by FILE2.DOC with a six character margin, still
  102. with the 12 character tabs from FILE1.DOC. Finally, FILE3.DOC is
  103. printed with the 6 character margin from before and 8 character
  104. tabs.
  105.  
  106. You can specify the column width using the -w command. This can
  107. be up to 78 characters across with no margin, reducing
  108. proportionately according to the margin. To print a narrow file
  109. with a column width of 65 and a margin of 20, use
  110.  
  111. C> PRINT160 -m20w65 FILE1.DOC
  112.  
  113. If you specify the width before the margin, the margin setting
  114. will be subtracted from the total width of the columns. So, for
  115. example (again)
  116.  
  117. C> PRINT160 -w78m6 FILE1.DOC
  118.  
  119. Will actually give a column width of 75 each, since the 6
  120. characters from the margin have been subtracted from the total
  121. column width.
  122.  
  123. The vertical bar down the centre of the page can be switched off
  124. by using the -v option. This is useful for documentation where
  125. you can be sure of a reasonable gap down the centre of the page.
  126. Alternatively, you can specify a central gap of up to 16
  127. characters, which will have a vertical bar down the middle unless
  128. it has been turned off with -v. For example
  129.  
  130. C> PRINT160 -w40g7v FILE1.DOC
  131.  
  132. Will print two forty character wide columns separated by a gap of
  133. seven characters, with no central vertical bar.
  134.  
  135. All of this so far assumes letter size ( 11 inch ) paper. To
  136. switch to A4, use the -a option. To change back to letter again,
  137. use -l. The default is -l.
  138.  
  139. Finally, if you wish to redirect the output to the screen ( not
  140. very useful ) or to a file, you can use the -p option. This must
  141. be followed immediately by a filename, PRN: or CON: for direction
  142. to a file, the printer, or the console ( screen ). It must be the
  143. first thing on the command line after PRINT160, and must not be
  144. placed together with any other options. In these three examples,
  145. the first one is correct, the second two are not:
  146.  
  147. C> PRINT160 -pPRFILE.OUT -w40g7v FILE1.DOC
  148.  
  149. C> PRINT160 -w40g7v -pPRFILE.OUT FILE1.DOC     <<<<WRONG
  150.  
  151. C> PRINT160 -pPRFILE.OUTw40g7v FILE1.DOC       <<<<WRONG
  152.  
  153. In the first wrong case, the options will be sent to the default
  154. printer device before output is redirected. In the second, the
  155. program will attempt to open a file called "PRFILE.OUTW40G7V"
  156. which will most likely fail.
  157.  
  158. The rationale behind this is so that you can dump off a file that
  159. you can then print in the background using PRINT ( the standard
  160. MS-DOS print spooler ), or you can distribute documentation in
  161. printer-ready form, so that everyone else can print it out in
  162. 160-column mode.
  163.  
  164. When printing documents containing formatting codes ( see below ), 
  165. it is useful for the program to know the default font code. This 
  166. can safely be omitted, but printing will slow down considerably. 
  167. If you know it, it can be specified with the -f option:
  168.  
  169. C> PRINT160 -f2 FILE1.DOC
  170.  
  171. This will stop PRINT160 putting default font changes on each line.
  172.  
  173. Don't worry if you can't remember all of these - typing PRINT160
  174. by itself will bring up a helpful message with a quick reminder
  175. of what each option does.
  176.  
  177. Lastly, if you use a specific set of options a lot, you will not 
  178. want to type them every time you print out a file. They can be 
  179. placed in an environment variable called P160OPTS. For example, if 
  180. the default page layout was -w40g7v ( column width 40, gap 7, 
  181. vertical centre line off ), then the command
  182.  
  183. C> SET P160OPTS=-w40g7v
  184.  
  185. Would make this the default. The next time you run PRINT160, it 
  186. will act as if you typed -w40g7v as the first option on the 
  187. command line.
  188.  
  189. Don't worry if you can't remember all of these - typing PRINT160
  190. by itself will bring up a helpful message with a quick reminder
  191. of what each option does.
  192.  
  193.  
  194. 3. ERRORS
  195. ---------
  196.  
  197. There are several situations that PRINT160 will recognise as
  198. errors. You will then get one of the following messages:
  199.  
  200. ERROR: Margin too wide
  201.     The margin specified was over 99 characters wide. Specify
  202.     a narrower margin.
  203.  
  204. ERROR: Tabs too wide
  205.     The tab spacing specified was greater than 16. Use
  206.     narrower tabs.
  207.  
  208. ERROR: Tabs too narrow
  209.     The tab spacing specified was less than 2. Use wider
  210.     tabs.
  211.  
  212. ERROR: Gap too wide
  213.     The central gap is wider than 16 characters. Use a
  214.     narrower gap.
  215.  
  216. ERROR: Columns too wide to fit
  217.     The column width specified is too big to fit in the paper
  218.     with the current margin and gap. Reduce any of these.
  219.  
  220. ERROR: Only one alternative printer output allowed
  221.     The printer output has already been redirected to an
  222.     alternative file. It cannot be redirected again.
  223.  
  224. ERROR: '<letter>' is an invalid option
  225.     The letter displayed is not one of the allowed option
  226.     letters (aglmptv or w). Correct the option string.
  227.  
  228. ERROR: Cannot open <filename> for output
  229.     The alternative printer output cannot be opened for some
  230.     reason. Check that it is a valid filename.
  231.  
  232. ERROR: Cannot open file <filename>
  233.     The file <filename>, which is to be printed out, cannot
  234.     be opened. Check that it exists.
  235.  
  236. ERROR: Invalid option string
  237.     Should never happen. If it does, tell me !
  238.  
  239.  
  240. 4. ESCAPE CODE SUMMARY
  241. ----------------------
  242.  
  243. For those of you "in the know", the print formatting codes that
  244. PRINT160 understands are given below, together with what action is
  245. taken with them. They are a subset of the standard Epson ESC/P
  246. format code standard, and should work with any printer which
  247. claims to be Epson compatible.
  248.  
  249. Code    Action            Action with PRINT160
  250.  
  251. ESC @    Reset printer        Resets PRINT160's flags
  252. ESC s    Half speed mode        Passed through to printer
  253. ESC <    Home print head        Print position homed
  254. ESC U    Unidirectional print    Passed through to printer
  255. ESC >    Set bit 8 of data    Passed through to printer
  256. ESC =    Clear bit 8 of data    Passed through to printer
  257. ESC #    Cancel bit 8 control    Passed through to printer
  258. DC3    Deselect printer    Ignored
  259. DC1    Select printer        Ignored
  260. ESC EM    Sheet feeder control    Passed through to printer
  261. CR    Carriage return        Print position homed
  262. BEL    Sound beeper        Ignored
  263. BS    Backspace        Passed through to printer
  264. DEL    Delete character    Last character deleted
  265. CAN    Cancel line        Home print position
  266. LF    Line feed        Go to start of next line
  267. ESC J    Line feed        Go to start of next line
  268. ESC 0    Set line spacing    Ignored
  269. ESC 2    Set line spacing    Ignored
  270. ESC 3    Set line spacing    Ignored
  271. ESC A    Set line spacing    Ignored
  272. FF    Form feed        Go to start of next column
  273. ESC C    Set page length        Ignored
  274. ESC N    Set bottom margin    Ignored
  275. ESC O    Cancel bottom margin    Ignored
  276. ESC B    Set vertical tabs    Ignored
  277. ESC e    Set vertical tabs    Ignored
  278. ESC b    Set vertical tabs    Ignored
  279. ESC /    Set tab channel        Ignored
  280. VT    Vertical tab        Go to start of next line
  281. ESC f    Set print position    Go to print position
  282. ESC Q    Set right margin    Ignored
  283. ESC l    Set left margin        Ignored
  284. ESC D    Set horizontal tabs    Ignored
  285. ESC e    Set tab spacing        Tab spacing set
  286. HT    Tab            Tab to next tab stop
  287. ESC SP    Set character space    Ignored
  288. ESC $    Set dot position    Passed through to printer
  289. ESC \    Set relative position    Passed through to printer
  290. ESC a    Set justification    Ignored
  291. ESC x    Set print mode        Passed through to printer
  292. ESC k    Set font        Passed through to printer
  293. ESC !    Style select        Passed through to printer
  294. ESC M    Select 12-pitch chars    Ignored
  295. ESC P    Select 10-pitch chars    Ignored
  296. ESC g    Select 15-pitch chars    Ignored
  297. ESC p    Set proportional    Passed through to printer
  298. SI    Set condensed        Ignored
  299. ESC SI    Set condensed        Ignored
  300. DC2    Cancel condensed    Ignored
  301. SO    Set wide        Passed through to printer
  302. ESC SO    Set wide        Passed through to printer
  303. DC4    Cancel wide        Passed through to printer
  304. ESC W    Set/cancel wide        Passed through to printer
  305. ESC w    Set/cancel dbl height    Cancel/set subscript
  306. ESC E    Set emphasized        Passed through to printer
  307. ESC F    Cancel emphasized    Passed through to printer
  308. ESC G    Set double strike    Passed through to printer
  309. ESC H    Cancel double strike    Passed through to printer
  310. ESC S    Set super/subscript    Ignored
  311. ESC T    Cancel super/subscript    Ignored
  312. ESC -    Set/cancel underline    Passed through to printer
  313. ESC R    Select character set    Passed through to printer
  314. ESC 4    Select italics        Passed through to printer
  315. ESC 5    Cancel italics        Passed through to printer
  316. ESC 6    Expand print area    Passed through to printer
  317. ESC 7    Contract print area    Passed through to printer
  318. ESC &    Define characters    **NOT SUPPORTED**
  319. ESC :    Copy default char set    Passed through to printer
  320. ESC %    Set user char set    Passed through to printer
  321. ESC x    Set LQ/draft print    Passed through to printer
  322. ESC *    Bit image printing    **NOT SUPPORTED**
  323. ESC K    Bit image printing    **NOT SUPPORTED**
  324. ESC L    Bit image printing    **NOT SUPPORTED**
  325. ESC Y    Bit image printing    **NOT SUPPORTED**
  326. ESC Z    Bit image printing    **NOT SUPPORTED**
  327. ESC ?    Bit image printing    **NOT SUPPORTED**
  328.  
  329. The codes marked "NOT SUPPORTED" are not processed by PRINT160 and
  330. should thus not be used. If you do, the results will certainly be
  331. unpredictable.
  332.  
  333.  
  334. 5. CREDITS
  335. ----------
  336.  
  337. PRINT160 was written entirely in TURBO-C from Borland. It was
  338. then compressed for release by PKZIP v1.02, from PKWARE. This is
  339. a very handy program also available through the public domain,
  340. and so is well worth the plug.
  341.  
  342.  
  343. 6. SOFTWARE LICENSE
  344. -------------------
  345.  
  346. It's the legal bit !
  347.  
  348. PRINT160 is Copyright Sean T Ellis 1991.
  349.  
  350. You are free to use, copy and distribute PRINT160 for
  351. NONCOMMERCIAL use if:
  352.  
  353. No fee is charged for use, copying or distribution.
  354.  
  355. It is not modified in any way.
  356.  
  357. Clubs and user groups may charge a nominal fee not to exceed
  358. £3.50 for expenses and handling while distributing PRINT160.
  359.  
  360. Commercial software licences are available for a flat fee of £50
  361. from the address below.
  362.  
  363. Sean T Ellis ("The author") hereby disclaims all warranties
  364. relating to this software, whether express or implied, including
  365. without limitation any implied warranties of merchantability or
  366. fitness for a particular purpose. The Author will not be liable
  367. for any special, incidental, consequential, indirect or similar
  368. damages due to loss of data or any other reason, even if The
  369. Author or an agent of The Author has been advised of the
  370. possibility of such damages.  In no event shall The Author's
  371. liability for any damages ever exceed the price paid for the
  372. license to use software, regardless of the form of the claim.
  373. The person using the software bears all risk as to the quality
  374. and performance of the software.
  375.  
  376.  
  377. 7. WATCH THIS SPACE
  378. -------------------
  379.  
  380. Since PRINT160 is continually being updated as I use it more and
  381. more, there will probably be future releases on an irregular
  382. basis. Keep your eyes peeled ! Any comments or suggestions that
  383. you send may appear in later versions.
  384.  
  385. You can get in contact with me via the following address:
  386.  
  387.     Sean Ellis
  388.     39 Connaught Road
  389.     Reading
  390.     Berkshire    RG3 2UD
  391.     ENGLAND
  392.  
  393.  
  394.                             Sean