home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / post.zip / POST.DOC < prev    next >
Text File  |  1992-01-02  |  18KB  |  495 lines

  1.  
  2.                             POST 2.1
  3.  
  4.  
  5. Introduction:  This document describes the MS-DOS utility POST.
  6. POST is a utility that gives MS-DOS based PC's the ability to
  7. print directly to PostScript printers from the DOS prompt.  This
  8. information applies to version 2.1 of the POST utility.
  9.  
  10. Background:  The first PostScript based printer was introduced by
  11. Apple Computer.  This printer helped establish the desktop
  12. publishing industry because it incorporated PostScript, the
  13. sophisticated Page Description Language (PDL), developed by
  14. Adobe.  The printer was designed to work with the Apple Macintosh
  15. using an Apple developed interface called AppleTalk.  The printer
  16. designers did however include an RS-232 port so that it could be
  17. connected to other computers such as the IBM-PC and clones.
  18. Software developers soon discovered the power of PostScript and
  19. began to write printer drivers for PC application programs.  One
  20. serious drawback however, is the lack of a PostScript driver for
  21. MS-DOS.  The POST utility is an attempt to solve this oversight.
  22.  
  23. Purpose:  POST allows users of PC's to print ASCII files directly
  24. to PostScript printers.  It is intended to provide PostScript
  25. support for programs that do not have the necessary drivers, and
  26. to allow direct printing of DOS files.  POST allows directory
  27. listings to be piped through it directly to a PostScript printer.
  28. POST also allows the user to print files that have been created
  29. by spreadsheet and database programs that can print to ASCII
  30. files.
  31.  
  32. The user can specify a variety of parameters that will affect the
  33. appearance of the output.  These parameters include the top, bottom,
  34. left margins, and the font style, size and leading.  Options for
  35. scaling, rotation and translation are also provided.  Version 2.0
  36. also allows PostScript commands to be embedded in the source file.
  37. This can be used to include box drawing, shading, font changes,
  38. logos and other PostScript functions on the printed page.
  39. (This feature requires some knowledge of the PostScript language.)
  40. The ability to include PostScript commands is very powerful and can
  41. be used to produce almost anything.
  42.  
  43. Function:  POST Reads data from the standard input device,
  44.            converts it to PostScript format, then writes the data to
  45.            the standard output device.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.                                 1
  54.  
  55.                             POST 2.1
  56.  
  57.  
  58. Command Line Format:  (options are explained on next pages)
  59.  
  60.      [d:][path]POST[option 1 value(s) ... option n value(s)]
  61.  
  62. Upper or lower case is OK except for Font names (this will be
  63. explained later).  There are 72 points per inch.  The default
  64. page origin is located at the lower left corner with positive X
  65. to the right and positive Y upwards.
  66.  
  67. The output filename must be different from the input filename.
  68. POST will space to the next column position if it finds a tab
  69. character.  Column positions can be defined as preset distances
  70. from the left margin.  POST will skip to top of form if it finds
  71. a form feed character. POST will ignore control characters other
  72. than line feed, form feed and tab.
  73.  
  74. OPTIONS:         LETTER:    VALUE(S):                          DEFAULTS:
  75.  
  76. Left Margin         L       Left margin in points              L 54
  77. Top Print Line      T       Top print position in points       T 720
  78. Bottom Print        B       Bottom print limit in points       B 54
  79. Column Tab          C       Column tab spacing in points       C 56
  80. Typeface Size       P       Typeface size in points            P 12
  81. Leading             D       Vertical line spacing in points    D 12
  82. Typeface Font       F       Selected font for printing         F Courier
  83. Scaling             S       X and Y scaling multipliers        S 1.0 1.0
  84. Page Origin         X       X and Y page translation points    X 0 0
  85. Page Orientation    R       Page rotation angle in degrees     R 0
  86.  
  87. Details of Options:
  88.  
  89. L:   The left margin is the value assigned in points (72 per inch) to
  90.      the leftmost printing position on the page.  For instance, if you
  91.      want to start printing one inch from the left side of the page you
  92.      would include the option - L 72.
  93.  
  94. T:   The top margin is used by the printer every time a new page is
  95.      started. Its value is the number of points (72 per inch) from the
  96.      bottom of the page to the beginning character position of the first
  97.      line on the page.  Remember that if you decide to print in the
  98.      landscape mode, you will have a smaller number of points to the
  99.      first line.  POST uses 720 points as the first line default (10
  100.      inches times 72 points per inch).
  101.  
  102.  
  103.  
  104.  
  105.  
  106.                                 2
  107.  
  108.                             POST 2.1
  109.  
  110.  
  111. B:   The bottom margin is used by the printer to decide when to start a
  112.      new page.  Every time a new line is started the amount of
  113.      line-to-line space defined (see D - leading) is subtracted from the
  114.      current position on the page to see if enough room is available.
  115.      If not, the current page is printed and printing starts at the top
  116.      of a new page.  If you are using embedded form feed control, be
  117.      sure to set the bottom margin to a value that will keep from
  118.      automatically paging before you want to.  Also, most PostScript
  119.      printers cannot print closer than one fourth to one half inch of
  120.      the edge of the paper.
  121.  
  122. C:   The column tab spacing is the increment in points to be added to
  123.      the left margin for each tab column across the page.  The default
  124.      tab column for the first tab is 54 points for the left margin plus
  125.      56 points.  The next tab column is 56 points more than the first.
  126.  
  127. P:   One advantage of PostScript printers is that they can print
  128.      characters in any size desired because they are defined in a manner
  129.      that allows them to be scaled very accurately.  POST allows any
  130.      integer value to be used.  The default size is 12 points which is
  131.      10 characters per inch.  Do not forget that the line-to-line
  132.      spacing must be adjusted in conjunction with the typeface size or
  133.      overprinting can result.  Normally the line-to-line (leading -
  134.      option D) spacing should be equal to or greater than the typeface
  135.      size.
  136.  
  137. D:   Leading is the line-to-line spacing value.  The name is derived
  138.      from when type was made from the metal of the same name - lead.
  139.      The lead was poured to make rows of letters and the space between
  140.      rows was the amount of leading.  Be sure to increase the leading
  141.      when you increase the type size to avoid overprinting.  The leading
  142.      value is also used to determine the number of lines per page by
  143.      subtracting its value from the calculated line position each time a
  144.      new line is started.
  145.  
  146. F:   The default font is Courier.  Any other font that is already in the
  147.      PostScript printer can be used.  Be sure to use upper and lower
  148.      case as described by the printer manual.  Examples for Courier are:
  149.      Courier, Courier-Bold, Courier-Oblique and Courier-BoldOblique.  If
  150.      you have downloaded a special font, you can select it.  The
  151.      PostScript printer will ignore requests for incorrectly identified
  152.      fonts.  Please remember that most of the fonts other than Courier
  153.      are proportional and that column data will not be lined up.
  154.      Examples other than Courier are not shown because most of the fonts
  155.      are copyrighted.
  156.  
  157.  
  158.  
  159.                                 3
  160.  
  161.                             POST 2.1
  162.  
  163.  
  164. S:   Scaling is done by the PostScript printer.  It multiplies each X
  165.      and Y coordinate by the X and Y scaling factors that you have
  166.      provided.  The printout can be enlarged or reduced.  The X and Y
  167.      scaling factors are the only ones that POST allows to be
  168.      non-integers.  POST sends translation, orientation and finally
  169.      scaling values sequentially to the printer.
  170.  
  171. X:   Page Origin:  This will allow you to translate the page origin to
  172.      any place on the page.  The values specified must be in points.
  173.      Remember that if you translate the origin, X and Y positive values
  174.      are still up and to the right.  If you translate the X coordinate
  175.      of the origin to the top of the page, nothing will print because it
  176.      will be off the page!  Also, any characters that extend beyond the
  177.      right edge of the page will also not print.  Generally if you
  178.      translate the page origin you also need change the orientation of
  179.      the page with the Rotate command (option R).
  180.  
  181. R:   Rotation of the coordinate system can be very confusing.  The
  182.      PostScript printer rotates the page image counter-clockwise by the
  183.      number of degrees requested.  POST expects the number to be an
  184.      integer - i.e. one degree increments.  POST sends the rotation
  185.      value after it sends the translation values but before scaling.
  186.      See the example of landscape page orientation for an example 
  187.      and experiment using variations.
  188.  
  189.  
  190. Examples: The following performs a standard directory function, pipes
  191.           the output as a standard input to POST and POST converts the
  192.           directory listing to PostScript format and sends it to the
  193.           PostScript printer:
  194.  
  195.           C>DIR | POST > PRN
  196.  
  197.  
  198.           The following sends the file infile.ext to POST, POST converts
  199.           it to PostScript format and sends it to the file outfile.ext:
  200.  
  201.           C>POST < infile.ext > outfile.ext
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.                                 4
  213.  
  214.                             POST 2.1
  215.  
  216.  
  217.           The following prints a page in the landscape mode by setting
  218.           the top of page at 540 points, translating the origin to the
  219.           upper left corner and rotating the page counter-clockwise 270
  220.           degrees:
  221.  
  222.           C>POST T 540 X 0 792 R 270 < infile.ext > PRN
  223.  
  224.           The following prints very full pages by setting the left
  225.           margin to 24 points, top of page to 756 points and the bottom
  226.           of page to 24 points:
  227.  
  228.           C>POST l 24 t 756 b 24 < infile.ext > PRN
  229.  
  230. Hint:     If there are specific functions that you are going to use
  231.           often, create batch files with the required options.  See your
  232.           DOS manual for more information about creating batch files.
  233.           Sample batch files are included with this documentation.
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.                                 5
  266.  
  267.                             POST 2.1
  268.  
  269.  
  270. Computer Connections:
  271.  
  272. The purpose of this section is to help you establish the correct
  273. connection and communication method between your computer and PostScript
  274. printer.
  275.  
  276. POST was developed for people who have a PC (or clone) with a PostScript
  277. printer connected to the parallel port of their PC.  That is why the
  278. examples are using "PRN" as the output device.  If you have this
  279. configuration, you should have no trouble using the POST utility.
  280.  
  281. Making the PostScript printer work with a serial connection is slightly
  282. more difficult.  The printer and the PC must be set to communicate at
  283. the same speed.  9600 bits-per-second must be used on the LaserWriter.
  284. To set up DOS to communicate correctly, enter the following incantation
  285. at the DOS prompt.  Substitute the correct COM port if yours is
  286. different.
  287.  
  288.           MODE COM1:9600,N,8,1,P
  289.  
  290. This tells DOS to talk to serial device COM1 at 9600 bits-per-second,
  291. with no parity, eight data bits, one stop bit and to continuously retry
  292. to send upon receipt of time out errors from the asynchronous adapter.
  293.  
  294. You may also want to enter the following:
  295.  
  296.           MODE LPT1:=COM1:
  297.  
  298. This tells DOS to re-route information intended for the parallel port to
  299. the specified serial port.  You may not need this.
  300.  
  301. Next set your printer to use the serial port at 9600 bits per second
  302. (see your printer manual).
  303.  
  304. There is one problem that frequently occurs when a PostScript printer is
  305. attached to a PC via the serial ports on both devices.  The problem
  306. occurs because the default handshaking (or synchronization) method used
  307. by the devices are different.  By default, the Laserwriter and other
  308. PostScript printers use XON/XOFF (software) handshaking.  The PC, on the
  309. other hand, uses DSR/DTR (hardware) handshaking.  The problem is
  310. exacerbated by the fact that many application programs for the PC
  311. control the serial port directly and implement the software handshake
  312. protocol.  This means that your word processor could produce perfect
  313. documents, but the POST utility would not work from the DOS prompt.
  314.  
  315.  
  316.  
  317.  
  318.                                 6
  319.  
  320.                             POST 2.1
  321.  
  322.  
  323. In order to solve this problem, a couple of options are available.
  324. The first is to change the default handshaking method of the printer,
  325. and the second is to change the default handshaking method of the PC.
  326.  
  327. To change the default handshaking method of the printer, you send a
  328. small PostScript program to it.  On some printers (such as the NT and
  329. the NTX) you can also change it via the DIP switches.  Early versions of
  330. the Laserwriter will not allow you to change the default handshaking
  331. method.  If you change the default handshaking method of the printer, a
  332. correctly wired cable is essential.  The PostScript program is shown
  333. below.  Copy it to the printer using the DOS COPY command.
  334.  
  335.  
  336. 0000 % Server Password (zeros, not oh's)
  337. statusdict begin 25 sccbatch 4 ne exch 9600 ne or {serverdict begin
  338. exitserver}{pop end stop}ifelse statusdict  begin
  339. 25  9600  4  setsccbatch
  340. end
  341.  
  342.  
  343. Create the file listed above using EDLIN or a wordprocessor that can
  344. create a simple ASCII file.  Embed a control D as the last character to
  345. tell the printer that this is the end of the data.  (Most MS-DOS based
  346. word processors and text editors support the default method of holding
  347. down the ALT key and entering the decimal value of the required control
  348. character on the keypad.  To enter a control D hold down the ALT key and
  349. enter 004 on the keypad.  To enter a control character with EDLIN, type
  350. Ctrl-V, then press the Capital D.)  This program makes a semi-permanent
  351. change to the printer.  That is - it will stay in DSR/DTR protocol until
  352. you change it again.  To switch back to XON/XOFF change the two "4"s to
  353. "0"s (zeros, not oh's).
  354.  
  355. To change the default handshaking method of the PC, you may need to use
  356. a copy of the program XONXOF.COM included in the ARC file.  This program
  357. is a TSR which means it does not go away until you turn off the
  358. computer.  Some PC clones allow you to specify the handshaking mode of
  359. the serial ports.  If yours does you should have no trouble once you set
  360. it for XON/XOFF.
  361.  
  362. NOTE:
  363.  
  364. If you have been using POST.COM (a previous version of this utility)
  365. you will need to remove it from the directory when you install POST.EXE.
  366. Otherwise, DOS will execute the old version.  DOS always executes the
  367. file with the .COM extension if it exits even if you type in the .EXE
  368. extension.
  369.  
  370.  
  371.                                 7
  372.  
  373.                             POST 2.1
  374.  
  375.  
  376. Embedded PostScript:
  377.  
  378. Version 2.1 has incorporated the ability to send PostScript commands
  379. directly to the printer without intervention.  This capability can be
  380. used to include a company logo on the page, or to draw boxes on the
  381. page to highlight columns or rows.  Almost any valid PostScript commands
  382. can be sent using this feature (some knowledge of the PostScript
  383. language is required). To embed PostScript commands in your file you
  384. should enter a CTRL-^ (hold down the CTRL key on the keyboard and
  385. press the ^ key).  On most PCs, the ^ is above the 6 and CTRL-6 will
  386. sometimes work.  Next enter a <RETURN> followed by the desired set
  387. of PostScript commands. Next enter a <RETURN> followed by another CTRL-^.
  388.  
  389. The POST utility interprets the CTRL-^ as follows:
  390.  
  391. When the first CTRL-^ (Decimal 30 or Hex 1E or Octal 36) is found,
  392. POST sets a flag and sends all other characters directly to the 
  393. printer (or file).  When the next CTRL-^ is encountered, POST
  394. reverts to its normal self.  In this fashion, all sorts of control 
  395. can be exerted upon the output of a PostScript printer.   For example,
  396. if the following code were embedded in a normal ASCII file, a shaded
  397. logo would show up on the background of the output.  Please make sure
  398. that the CTRL-^ is the first character of the embedded PostScript
  399. code and it is recommended that you use either a save-restore pair or a
  400. gsave-grestore pair to surround your embedded code to avoid corrupting
  401. the remainder of the code generated by the POST utility.
  402.  
  403.  
  404.       Example: 
  405.  
  406. 
  407.     gsave    % there is a CTRL-^ before the gsave
  408.                   200 175 moveto
  409.                   500 175 lineto
  410.                   500 225 lineto
  411.                   200 225 lineto
  412.                   closepath
  413.                   .5 setgray
  414.                   fill
  415.                   /Times-Roman findfont 50 scalefont setfont
  416.                   250 185 moveto
  417.                   1 setgray
  418.                   (POST 2.1) show
  419.                   gsave 250 185 moveto 0 setgray
  420.                    (POST 2.1) true charpath stroke grestore
  421.     grestore  % there is a CTRL-^ after the grestore
  422. 
  423.                
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.                                 8
  441.  
  442.                             POST 2.0
  443.  
  444.  
  445. The save-restore (or gsave-grestore) should surround the PostScript
  446. code if it is independent of the current page.  Embedded PostScript
  447. commands can be included anywhere in a file (the result of the code
  448. will be printed on the page that is currently being rasterized.)
  449.  
  450.  
  451.  
  452.  
  453. Shareware:      This program is distributed as Shareware.  If you
  454.                 find this program useful, send $10.00 to:
  455.  
  456.  
  457.                         F. C. Betts
  458.                         c/o Veda Incorporated
  459.                         Suite 200
  460.                         5200 Springfield Pike
  461.                         Dayton, OH 45431
  462.  
  463.         Any comments and/or suggestions will be appreciated and a
  464.         response will be sent if possible.
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.                                 9
  494.  
  495.