2

Is there any way to achieve this PDF output on Linux?
By this I mean the alternate blue/green bars, which used to be pre-printed on paper for dot-matrix printers. The guides/holes in the sides would be a nice bonus!

enter image description here

There is a program in Windows, HercPrt which produces this result, either from Hercules emulator or by a text to PDF converter. I'm looking for a CUPS virtual printer perhaps, to produce the bars, or a text to PDF converter, or even a template in LibreOffice. Other ideas are welcome of course.

Krackout
  • 123

4 Answers4

3

Since I had the same problem you had, I've written prt1403, which is available on GitHub: printer 1403.

An example, this is the image of a blue banded, 9.5" wide paper, mono-spaced character set listing:

image of a blue banded, 9.5" wide paper, mono-spaced character set listing with alternating colors

The following options have been added:

  • Continuous printing (no page header, 66 lines per page).
  • Paper sizes 9.5", 12" or 14.5".
  • Paper colors green banded, blue banded or standard white
  • Support for choice of font type and size.
  • Input from stdin, output to stdout.
  • Printing multiple files separated by separator page with file number.
  • Separator page.

enter image description here

2

Using Postscript, one can generate something like:

Pseudo Continuous Form

The "perforations" are round, but when converting the PDF to a JPG, they became square :-(. The text on the white background isn't bold either.

The output you see is created by a postscript program that follows. Don't look too close, it's my maiden postscript speech. It constructs a background (the contform procedure) at the beginning of each page, reads a text file (/tmp/passwd) and prints it at 6lpi on your default page format (in my case A4). To execute this script, start it with ghostscript (gs) or ghostview (gv). When you save the script as /tmp/contform.ps, then

gs /tmp/contform.ps

or

gv /tmp/contform.ps.

The script:

/CP /closepath load def
/MT /moveto load def
/LT /lineto load def
/S /stroke load def
/F /fill load def
/s 20 string def

/pw { currentpagedevice /PageSize get 0 get } def /ph { currentpagedevice /PageSize get 1 get } def

.83 1 1 setrgbcolor

% 0 ph MT pw ph LT pw ph 36 sub LT 0 ph 36 sub LT CP F

/contform { gsave .83 1 1 setrgbcolor ph -1 mul 72 0 { /i exch def ph i add dup 12 exch MT dup pw 12 sub exch LT dup pw 12 sub exch 36 sub LT dup 12 exch 36 sub LT CP F pop } for 0 setgray ph -1 mul 72 0 { /i exch def /perf { 3 0 360 arc CP F } bind def ph i add 18 add dup 6 exch % left perforation center perf dup 36 sub 6 exch % 2nd left perforation center perf dup pw 6 sub exch % right perforation center perf dup 36 sub pw 6 sub exch % 2nd right perforation center perf pop } for grestore } bind def

/bottom 12 def /lineshow % (string) lineshow - { %def % works like show, but checks for bottom % of page and also moves current point % down one line after each call currentpoint exch pop % just the Y coord bottom lt { %if showpage contform 12 ph 24 sub moveto % top of new page } if gsave show grestore 0 -12 rmoveto % down one line } bind def

%list the /tmp/passwd file /Courier findfont 10 scalefont setfont 0 setgray

contform 12 ph 24 sub moveto /datafile (/tmp/passwd) (r) file def /buffer 256 string def { %loop datafile buffer readline { %ifelse lineshow }{ %else datafile closefile exit } ifelse } bind loop

showpage

2

Somewhat late, but you can use this virtual line printer. https://github.com/racingmars/virtual1403

It was designed to emulate a real 1403 printer for Mainframes, to be used with the Hercules system, so serves as one of the output printers for emulated MVS or other mainframes OSs. The green bar paper size and design is the same as the real one. It handles directly EBIDC, but it has a stand-alone version (feature requested by me!) so you can feed any text file.

example of printed output from mainframe emulation

dsv87
  • 21
1

...By the way - the printout on that picture is not from a dot-matrix printer. That is either a Chain, Train, or Band printer. They were high-speed impact printers you'd used by mainframe computers... https://www.pcmag.com/encyclopedia/term/chain-printer Not that it matters for the paper or your virtual printout, but I thought I'd make a comment ;)

Braino
  • 41