|
From: | Michael Anderson |
Subject: | Re: [open-cobol-list] Addressing printer in report writer program. |
Date: | Sat, 08 Mar 2014 14:26:38 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
I'm somewhat of a newbie to Cobol,
writing COBOL since the 1980's, and also I never used the Cobol
report writer.
After looking at the simple example by Rildo Pragana, I may actually start using it. I think Brian Tiffin has an example in the Cobol FAQ of Cobol calling CUPS directly, which would be better than opening /dev/lp0 directly. For anyone who likes Tcl, Using the posted example, the cobol report is in a file 'printer.text', so I would use pdf4tcl, and do the following: cat
printing.text|./lp2pdf -p a4 -Fp 11 -Lp 50 -o printing Oh and lp2pdf is COBOL with some supporting C, and Tcl. There is much more that can be done with pdf4tcl. I have example files (lp2pdf source code) with a free format version of Rildo's test27 source here: http://www.j3ksolutions.net/reportwriter/ Requires tcl 8.5 or higher, and the
"pdf4tcl" package. Mike. On 03/08/2014 12:17 AM, Kevin Monceaux wrote: On Fri, Mar 07, 2014 at 04:09:59PM -0500, john Culleton wrote:Or do I just send it to a Line-sequential file and print it off-line?The ACAS (Applewood Computers Accounting System) package might be a good place to look for examples of printing line-sequential files. It has two copybooks, one for portrait and one for landscape: *> *> Portrait *> 01 Print-Report. 03 filler pic x(117) value "lpr -r -o 'orientation-requested=3 page-left=48 page-top=24 " & "page-right=24 sides=two-sided-long-edge cpi=12 lpi=8' -P ". 03 PSN pic x(48) value "HPLJ4TCP ". *> This is the CUPS print spool, change it for yours 03 filler pic x(15) value "prt-1". *> Don't change this line *> *> Landscape *> 01 Print-Report. 03 filler pic x(117) value "lpr -r -o 'orientation-requested=4 page-left=18 page-top=48 " & "page-right=10 sides=two-sided-long-edge cpi=12 lpi=8' -P ". 03 PSN pic x(48) value "HPLJ4TCP ". *> This is the CUPS print spool, change it for yours 03 filler pic x(15) value "prt-1". *> Don't change this line Various programs write output to file prt-1 then print the output with: call "SYSTEM" using Print-Report. |
[Prev in Thread] | Current Thread | [Next in Thread] |