Tens 1 2 3 4 5 6 7 8 PRINTEXT.TXT Help for PRINTEXT.EXE www.merlyn.demon.co.uk >= 2004-08-11 PRINTEXT is a scriptable Delphi-3 Win-32 DOS-prompt command-line program designed to print specified plain-text files in specified formats on A4 paper, using the Windows default printer and driver. If the program is compiled with TP7/BP7, a test version is generated with printer routines logged to standard output instead. Otherwise, the Delphi/Windows printer routines are used. A Pascal EXE is under 25kB; a Delphi EXE is nearly 200 kB. Pascal scaling assumes 300 dpi on A4. Developed with Windows 98, Delphi 3, using an Epson Stylus C62 printer; but the program has no known significant dependence on that. Now I use a HP deskjet 5650; no alteration was needed. The programming was started mid-October 2002, and may change. The Delphi executable cannot be used to print under 16-bit DOS. Program Usage : prompt>PRINTEXT parameters Before the Command Line parameters are read, those in Environment Variable PRNTXCMD are read. Parameters and Script are read sequentially; initial / needed for settings. Commands just affect their variables; files are printed when met. A command is determined by its first character after / (xxx are deleted) : @name : Now read script file 'name'. Anumber : A-size of logical pages on A4 physical sheet. Bnumber : Binding, left of sheet, pixels; default = -1 -> about 13 mm. Cnumber : Columns on a logical page. Dnumber : Drop from line to line; default = 0 pixels = automatic. E : Exit. Fname : Font name; default = Courier New. Gnumber : Gutter, pixels ; default = -1 -> about 4 mm. Hnumber : Hue; default = 0 = black, others as below. Inumber : Initial sheet number to be actually printed. Lnumber : Page Orientation; default even = Portrait, odd = Landscape. Mnumber : Multiple-job, default 1. Nnumber : Mark - Fold, Sheet No., Page No. ; BitSet ; default 7 = all on. Onumber : Only to end of that number sheet. Qnumber : Querying each print; default odd = on, even = off. Rnumber : Repeat sheet count, default 1. Snumber : Size of font, points; default = 0 = scaled for Anumber. Tnumber : Two-Sided, Bind on odd sheets; default even = off, odd = on. Wword : Wait (e.g. for paper change) for Enter. Xnumber : Scaling; semiperimeter in pixels; default 0 => use actual. ; ... : comment to end of line. ! : test print. Defaults may change; I expect to get, by default, lines of 80 characters Portrait and 132 characters Landscape to fit. In a command line or script, font or file commands with spaces must be enclosed in "quotes". File names have no wildcards. Colours are Hex RGB additive ($00BBGGRR), if positive; otherwise by lookup : 0 Black, -1 Aqua, -2 Blue, -3 DkGray, -4 Fuchsia, -5 Gray, -6 Green, -7 Lime, -8 LtGray, -9 Maroon, -10 Navy, -11 Olive, -12 Purple, -13 Red, -14 Silver, -15 Teal, -16 White, -17 Yellow. Input can be piped, requ1ring Q0 & M=1 : dir /b scr* | PRINTEXT /C4 Printing : The printer is assumed to have portrait A4 paper; but the positioning is scaled to the alleged paper size. The Binding Margin is removed from the left long edge of the sheet. The remainder is then divided into pages according to the A-number (if B=0, these divisions will be of standard size). The printing area is then smaller than the page by Gutter on each edge. If Number is set, the top two lines are used for page header and spacing. The remainder is divided into Columns, without further Gutter. Text lines may or may not be clipped on the right of the sheet, page, or column. A FormFeed, if alone on a line, should move printing to the head of the next column. In the N number, starting with 0, add 1 for Fold Markings, 2 for Sheet Number, 4 for Page Number, 8 ... . It can be given in Hex as N$xy. Default Font Size is A4 10, A5 7, A6 5, A7 3, A8 2, A9... 1 - I think. Input line endings must be acceptable to Delphi. Tabs are handled, to cols 9, 17, 25, .... The program will not line-wrap or justify, and text is currently not clipped. Note that the representation of characters in #128..#255 depends on the font chosen. This description ignores whatever special capabilities the printer driver may have; and assumes the driver settings are consistent with the facts. US 11"*8.5" paper may work reasonably well. A5 paper might not. The reported paper half-perimeter is used to scale Bind & Gutter. Two-Sided cannot set the printer to use both sides; but the results can be copied. The Bind margin is not offset on even pages. Script, OK for 4*A6 Portrait Blue on A4 : ; unit of D is near 1/300 inch, for my C62 /A6 /H-2 ; fCourier New /D0 /L0 filename.ext ---