1827807 Members
2713 Online
109969 Solutions
New Discussion

Re: top-of-form

 
Fred Martin_1
Valued Contributor

top-of-form

In unix, if I create a text file and insert a TOF (^L) in the file, it works properly - when I print the doc it starts a new page at the TOF.

If I then take that same text file and ftp it to an NT machine, then print it from NT, it shows a small block on the page but does not treat it as a TOF.

Same printer.

In ftp, binary mode trashes the file. In ascii mode I've tried the flat file, and also tried ux2dos on the file first, same result.

Any ideas? I need to get the TOF tranfered over from unix.
fmartin@applicatorssales.com
9 REPLIES 9
Fred Martin_1
Valued Contributor

Re: top-of-form

I should say that when I print the file in unix, it is transferred to an NT machine using Facetwin software - then printed from NT to the same printer, which I'm trying to print to.

Facetwin just passes the file from the unix queue to an NT queue for printing.

Anyway that process retains the TOF.

When I ftp the file over and print it using, say, notepad or wordpad, the TOF is lost.
fmartin@applicatorssales.com
Goran Koruga
Honored Contributor

Re: top-of-form

Not sure why you posted this here, but ... ;)

Did you try "copy /b filename PRN:" ? Or maybe even using print command if it still exists in Windows.

I kinda forgot the DOS stuff, perhaps it's PRN and not PRN:.

G.
Fred Martin_1
Valued Contributor

Re: top-of-form

Thanks; I posted it here because it seemed less a DOS thing and more a unix thing - maybe I can modify the page before it is ftp'd to NT.

Here's the deal:

I have a unix script on a cron, which creates a nightly current email listing (the text file) based on current inboxes on the unix server.

The file in it's unix form is for sysadmins to use and print, from unix. General users do not have unix access.

But each night the same script also ftp's the text file over to an NT server, into a public folder.

Users on my network can just open the folder on their PC and browse or print the textfile with notepad or wordpad.

I set it up this way because it's self updating, PC users can get it when they want it, and is paperless if they want it to be.

Problem was, when they print it, the top-of-form behaves differently from notepad, as I described.

Was hoping there was an appropriate way to deal with the file from the unix side that would cause it to print properly on the NT side.
fmartin@applicatorssales.com
Fred Martin_1
Valued Contributor

Re: top-of-form

Goran,

You got me thinking now - maybe I should look at this the other way around.

Does anyone here know what you need to insert into a text file using notepad or wordpad, that causes a top-of-form or a page break?

If I knew that, I could have my unix script place the codes into the document prior to the ftp...
fmartin@applicatorssales.com
Goran Koruga
Honored Contributor

Re: top-of-form

It's hard to say without testing it, but my guess is that notepad or wordpad don't like such files.

If copy works then that is indeed the problem, and I don't see why copy would not work as I have always used it to transfer binary data directly to printer (i.e. to generate my own characters back then with my 9-pin Star printer).

G.
Goran Koruga
Honored Contributor

Re: top-of-form

Hello again Fred.

This is a rather silly idea, but still.

Can you generate such a document in wordpad/notepad ? If you can do it, then try to print it to a file and check the contents of this file.

G.
Shannon Petry
Honored Contributor

Re: top-of-form

This is a DOS/Windows issue. Windblows treats the control file as a character instead of binary character. Usually, it will translate it to a wingding or something stupid in windows, and the closest ASCII escape sequence it can find in DOS.

You can try the copy /b method, which may work in DOS. But... Be warned.. If you modify this file in windblows, your control sequence is deleted!

So, really this is a windows question ;) I have dealth with this as well as PJL commands that Windblows kindly strips from my prints. Hence I do all that I can from UNIX where I can control it.


Regards,
Shannon
Microsoft. When do you want a virus today?
Fred Martin_1
Valued Contributor

Re: top-of-form

I solved it, well enough for my purposes.

In unix, my script creates a text file called "textfile" which contains ^L (dec 12) where I want page breaks to be.

Sending it to a printer in unix properly prints TOF.

Then, in the same script, I copy it to "textfile.rtf" and ftp the file over to a public folder on an NT file server.

PC users that open the file can use MS wordpad or MS Office to open the file. It also correctly prints the TOF.
fmartin@applicatorssales.com
Fred Martin_1
Valued Contributor

Re: top-of-form

...which isn't completely foolproof by the way :)

I found old versions of MS Wordpad.exe (NT 4 for example) that do not support page breaks.
fmartin@applicatorssales.com