Electronics-Related.com
Forums

printing with formfeeds

Started by John Larkin April 14, 2021
On 04/14/21 19:51, John Larkin wrote:
> I have some old assembly listing files that are text, paged > by formfeed characters. I can't find a way to print nice > listings on a modern laser printer/copier. They ignore the > formfeeds or print a black box. > > Any ideas? > > Maybe I could write a program to replace the ff's with a > control sequence or something? >
A unix / Linux one line script using sed would do that. Using the substitute s command. Something like: echo <infile> | sed s/oldchar/newchar/ > <outfile> Don't do much script here, but quite amazing what can be done in a single line with standard commands and pipes... Chris
On Wednesday, April 14, 2021 at 4:47:12 PM UTC-7, chris wrote:
> On 04/14/21 19:51, John Larkin wrote: > > I have some old assembly listing files that are text, paged > > by formfeed characters. I can't find a way to print nice > > listings on a modern laser printer/copier. They ignore the > > formfeeds or print a black box. > > > > Any ideas? > > > > Maybe I could write a program to replace the ff's with a > > control sequence or something? > > > A unix / Linux one line script using sed would do that. Using > the substitute s command. Something like: > > echo <infile> | sed s/oldchar/newchar/ > <outfile> > > Don't do much script here, but quite amazing what can be done in > a single line with standard commands and pipes...
You also need to count lines before FF and pad up to 66 lines (55 + top and bot margins). That's exactly what "pr" does. Interesting to know how many ways to replace "pr".
John Larkin <jlarkin@highland_atwork_technology.com> wrote in
news:o5se7gppa00im5svc5ej766pt5184virgk@4ax.com: 

> On Wed, 14 Apr 2021 22:09:45 +0000 (UTC), > DecadentLinuxUserNumeroUno@decadence.org wrote: > >>Ed Lee <edward.ming.lee@gmail.com> wrote in >>news:304707f9-4854-4c75- b2a1-f8504ddbfd06n@googlegroups.com: >> >>> On Wednesday, April 14, 2021 at 11:52:04 AM UTC-7, John Larkin >>> wrote: >>>> I have some old assembly listing files that are text, paged >>>> by formfeed characters. I can't find a way to print nice >>>> listings on a modern laser printer/copier. They ignore the >>>> formfeeds or print a black box. >>>> >>>> Any ideas? >>>> >>>> Maybe I could write a program to replace the ff's with a >>>> control sequence or something? >>> >>> man pr >>> The old fashion way. >>> >> >>Output to a text file and then edit the file and remove the >>offending control sequences. > > It's already a text file, an assembly listing. > > The "control sequence" is a single formfeed character per page. > But I want that to shoot out a fresh page! > > There might actually be some escape sequence that the Cannon > copier/printer accepts as a page feed, but I can't find it. > >
I am saying to use a filter to pull everything out but the text. Then you can put whatever you want there to make it work right.
On Wed, 14 Apr 2021 14:31:18 -0700, John Larkin
<jlarkin@highland_atwork_technology.com> wrote:


>That isn't a real chain font; the characters are spaced too well >horizontally. Drum printers scattered them vertically. > >There must be typewriter and dot matrix fonts.
The 'old typewriter' and dot matrix fonts are easy to find but the creators of the whole programming paradigm didn't anticipate wanting variations like that. If you have access to a Adobe Indesign there's a free plugin from Beetroot Design called Humane Type that will convert all those sterile perfectly aligned characters into more organic crappy alignment. It's not ideal and some of the effects look like they were designed by a millenial trying to emulate photocopier distortions rather than typographic variations. A real artist would do each one individually. A real engineer would write a custom script. -- Best regards, Spehro Pefhany
John Larkin <jlarkin@highland_atwork_technology.com> wrote:
> On Wed, 14 Apr 2021 22:09:45 +0000 (UTC), > DecadentLinuxUserNumeroUno@decadence.org wrote: > >>Ed Lee <edward.ming.lee@gmail.com> wrote in news:304707f9-4854-4c75- >>b2a1-f8504ddbfd06n@googlegroups.com: >> >>> On Wednesday, April 14, 2021 at 11:52:04 AM UTC-7, John Larkin wrote: >>>> I have some old assembly listing files that are text, paged >>>> by formfeed characters. I can't find a way to print nice >>>> listings on a modern laser printer/copier. They ignore the >>>> formfeeds or print a black box. >>>> >>>> Any ideas? >>>> >>>> Maybe I could write a program to replace the ff's with a >>>> control sequence or something? >>> >>> man pr >>> The old fashion way. >>> >> >>Output to a text file and then edit the file and remove the offending >>control sequences. > > It's already a text file, an assembly listing. > > The "control sequence" is a single formfeed character per page. But I > want that to shoot out a fresh page!
The way that "pr" handles that is by adding the correct number of linefeeds at every formfeed character to skip exactly to the next page. It is a broken approach that falls apart when the printer does auto-wrap too long lines (printers did not do that at the time pr was written...) or when there are other uncontrollable vertical spacing problems.
> There might actually be some escape sequence that the Cannon > copier/printer accepts as a page feed, but I can't find it.
It normally is the formfeed (FF, hex 0C) character. When the printer does not recognize that, it is unlikely that it recognizes something else. These days, printers normally do not get fed with plain characters, CR, LF, TAB and FF. The pages get rendered in the computer and get sent in a page description language that is either some printer-dependent thing, or Postscript. The printer is not involved in layout issues anymore.
On Thu, 15 Apr 2021 01:45:54 +0000 (UTC),
DecadentLinuxUserNumeroUno@decadence.org wrote:

>John Larkin <jlarkin@highland_atwork_technology.com> wrote in >news:o5se7gppa00im5svc5ej766pt5184virgk@4ax.com: > >> On Wed, 14 Apr 2021 22:09:45 +0000 (UTC), >> DecadentLinuxUserNumeroUno@decadence.org wrote: >> >>>Ed Lee <edward.ming.lee@gmail.com> wrote in >>>news:304707f9-4854-4c75- b2a1-f8504ddbfd06n@googlegroups.com: >>> >>>> On Wednesday, April 14, 2021 at 11:52:04 AM UTC-7, John Larkin >>>> wrote: >>>>> I have some old assembly listing files that are text, paged >>>>> by formfeed characters. I can't find a way to print nice >>>>> listings on a modern laser printer/copier. They ignore the >>>>> formfeeds or print a black box. >>>>> >>>>> Any ideas? >>>>> >>>>> Maybe I could write a program to replace the ff's with a >>>>> control sequence or something? >>>> >>>> man pr >>>> The old fashion way. >>>> >>> >>>Output to a text file and then edit the file and remove the >>>offending control sequences. >> >> It's already a text file, an assembly listing. >> >> The "control sequence" is a single formfeed character per page. >> But I want that to shoot out a fresh page! >> >> There might actually be some escape sequence that the Cannon >> copier/printer accepts as a page feed, but I can't find it. >> >> > >I am saying to use a filter to pull everything out but the text. >Then you can put whatever you want there to make it work right.
I can write a program to find formfeeds and replace with some escape sequence that the copier/printer recognizes as a page feed; I just don't know what will work. Googling didn't help. Actually, I'm not sure that I can actually send a stream of characters to this kind of printer... opened as LPT3: or something. There may be drivers in the way.
On 15 Apr 2021 18:04:24 GMT, Rob <nomail@example.com> wrote:

>John Larkin <jlarkin@highland_atwork_technology.com> wrote: >> On Wed, 14 Apr 2021 22:09:45 +0000 (UTC), >> DecadentLinuxUserNumeroUno@decadence.org wrote: >> >>>Ed Lee <edward.ming.lee@gmail.com> wrote in news:304707f9-4854-4c75- >>>b2a1-f8504ddbfd06n@googlegroups.com: >>> >>>> On Wednesday, April 14, 2021 at 11:52:04 AM UTC-7, John Larkin wrote: >>>>> I have some old assembly listing files that are text, paged >>>>> by formfeed characters. I can't find a way to print nice >>>>> listings on a modern laser printer/copier. They ignore the >>>>> formfeeds or print a black box. >>>>> >>>>> Any ideas? >>>>> >>>>> Maybe I could write a program to replace the ff's with a >>>>> control sequence or something? >>>> >>>> man pr >>>> The old fashion way. >>>> >>> >>>Output to a text file and then edit the file and remove the offending >>>control sequences. >> >> It's already a text file, an assembly listing. >> >> The "control sequence" is a single formfeed character per page. But I >> want that to shoot out a fresh page! > >The way that "pr" handles that is by adding the correct number of >linefeeds at every formfeed character to skip exactly to the next page.
Is that a Linux thing? I thought about writing a program to do that, but Word seems to work.
> >It is a broken approach that falls apart when the printer does auto-wrap >too long lines (printers did not do that at the time pr was written...) >or when there are other uncontrollable vertical spacing problems.
Yes, some lines wrap, even in landscape mode.
> >> There might actually be some escape sequence that the Cannon >> copier/printer accepts as a page feed, but I can't find it. > >It normally is the formfeed (FF, hex 0C) character. When the printer >does not recognize that, it is unlikely that it recognizes something else. > >These days, printers normally do not get fed with plain characters, >CR, LF, TAB and FF. The pages get rendered in the computer and get sent >in a page description language that is either some printer-dependent >thing, or Postscript. The printer is not involved in layout issues >anymore.
On Wed, 14 Apr 2021 17:22:25 -0700 (PDT), Ed Lee
<edward.ming.lee@gmail.com> wrote:

>On Wednesday, April 14, 2021 at 4:47:12 PM UTC-7, chris wrote: >> On 04/14/21 19:51, John Larkin wrote: >> > I have some old assembly listing files that are text, paged >> > by formfeed characters. I can't find a way to print nice >> > listings on a modern laser printer/copier. They ignore the >> > formfeeds or print a black box. >> > >> > Any ideas? >> > >> > Maybe I could write a program to replace the ff's with a >> > control sequence or something? >> > >> A unix / Linux one line script using sed would do that. Using >> the substitute s command. Something like: >> >> echo <infile> | sed s/oldchar/newchar/ > <outfile> >> >> Don't do much script here, but quite amazing what can be done in >> a single line with standard commands and pipes... > >You also need to count lines before FF and pad up to 66 lines (55 + top and bot margins). That's exactly what "pr" does. > >Interesting to know how many ways to replace "pr".
Many times now I kind of wish I still had a nice page printer with tractor feed and lots of paper for those long listings... Like we used to do decades ago. I should not have recycled my big box of tractor feed paper just a few years ago !
On 4/15/2021 2:58 PM, boB wrote:
> Many times now I kind of wish I still had a nice page printer with > tractor feed and lots of paper for those long listings... Like we > used to do decades ago. > > I should not have recycled my big box of tractor feed paper just a > few years ago !
I have a box of 8.5x11 (microperf edges so you can rip the tractor feed holes off). But, I try hard to avoid paper. There are tools that let you annotate "electronic paper" in much the same way that you would markup paper listings in days past. Personally, I like not having stacks of paper lying around the office. There's enough shi^H^H^Htuff there, already! And, project listings that were 20-50 pages are now 2000 - 5000 pages...
On Thu, 15 Apr 2021 14:58:19 -0700, boB <boB@K7IQ.com> wrote:

>On Wed, 14 Apr 2021 17:22:25 -0700 (PDT), Ed Lee ><edward.ming.lee@gmail.com> wrote: > >>On Wednesday, April 14, 2021 at 4:47:12 PM UTC-7, chris wrote: >>> On 04/14/21 19:51, John Larkin wrote: >>> > I have some old assembly listing files that are text, paged >>> > by formfeed characters. I can't find a way to print nice >>> > listings on a modern laser printer/copier. They ignore the >>> > formfeeds or print a black box. >>> > >>> > Any ideas? >>> > >>> > Maybe I could write a program to replace the ff's with a >>> > control sequence or something? >>> > >>> A unix / Linux one line script using sed would do that. Using >>> the substitute s command. Something like: >>> >>> echo <infile> | sed s/oldchar/newchar/ > <outfile> >>> >>> Don't do much script here, but quite amazing what can be done in >>> a single line with standard commands and pipes... >> >>You also need to count lines before FF and pad up to 66 lines (55 + top and bot margins). That's exactly what "pr" does. >> >>Interesting to know how many ways to replace "pr". > > > >Many times now I kind of wish I still had a nice page printer with >tractor feed and lots of paper for those long listings... Like we >used to do decades ago. > >I should not have recycled my big box of tractor feed paper just a >few years ago ! >
You can still buy it. I see 2700 sheets for about $87 USD equivalent. I have a Panasonic KX-P1124 kicking around- you can still get clone ribbons for it at $14 for 6 pieces free ship in the US. But .. why ? These days most likely the issue is in some code that someone else wrote or in your interpretation of it. -- Best regards, Spehro Pefhany