[comp.lang.postscript] postscript from PS/2 to unix

mikulska@odin.ucsd.edu (Margaret Mikulska) (03/13/90)

One of our users has the following problem:

He's using a word processor "Nota Bene" from Dragonfly on his PS/2, 
under MS-DOS. The word processor creates a PostScript file which can
be saved with the "print-to-disk" command. Since he doesn't have a 
postscript printer, he transfers the file to a BSD-ish UNIX system
to print it out on an Apple LaserWriter.

When it turned out that the LaserWriter wouldn't print this file
from our UNIX system, I had a look at the file - it was obviously
in some format that no printer (attached to a unix system) would 
print as is. For starters, it didn't start with "%!"; the whole file, 
30,000 characters, was one single line (actually, 'wc' reported 
0 lines); but it did seem to contain a lot of PostScript commands.

I suppose that the file was created in some format suitable to be
sent from PS/2 directly to the printer (with MS-DOS command print,
for instance), but not to be ported to a unix or other system. 
Could somebody more familiar with PS/2, PCs, and word processors
on PCs tell me what's going on and how do I force the "Nota Bene"
word processor to produce an honest-to-goodness ps file ?

Any hint greatly appreciated.


Margaret Mikulska
systems administrator

UC San Diego
Dept. of ECE

mmikulska@ucsd.edu
MMIKULSKA@UCSD
ucsd!mmikulska

sun@me.utoronto.ca (Andy Sun Anu-guest) (03/15/90)

In article <7986@sdcsvax.UCSD.Edu> mikulska@odin.ucsd.edu (Margaret Mikulska) writes:
>One of our users has the following problem:
>
>He's using a word processor "Nota Bene" from Dragonfly on his PS/2, 
>under MS-DOS. The word processor creates a PostScript file which can
>be saved with the "print-to-disk" command. Since he doesn't have a 
>postscript printer, he transfers the file to a BSD-ish UNIX system
>to print it out on an Apple LaserWriter.
>
>When it turned out that the LaserWriter wouldn't print this file
>from our UNIX system, I had a look at the file - it was obviously
>in some format that no printer (attached to a unix system) would 
>print as is. For starters, it didn't start with "%!"; the whole file, 
>30,000 characters, was one single line (actually, 'wc' reported 
>0 lines); but it did seem to contain a lot of PostScript commands.
>
>I suppose that the file was created in some format suitable to be
>sent from PS/2 directly to the printer (with MS-DOS command print,
>for instance), but not to be ported to a unix or other system. 
>Could somebody more familiar with PS/2, PCs, and word processors
>on PCs tell me what's going on and how do I force the "Nota Bene"
>word processor to produce an honest-to-goodness ps file ?

First, I've never heard of a word processor called Nota Bene. However,
the symptoms that you mentioned (0 line) rings a bell. I had trouble
printing a MacDraft PostScript output file to a laser printer hooked
up to Unix before. I got the same 0 line business. It turned out that
the software didn't generate a new line character at the end of a line.
So when sent to Unix, no ^M at the end to wrap to a new line. Because of
this, you end up having an ultra-long line (imagine ONE line with 30,000
characters in it that even vi or wc fail to recognise it properly. 

What I did to overcome the problem was to write a tiny filter in C that
adds a "\n" whenever it sees a "\0". This should bring the file back
to normal. Last but not least, the word processor itself probably got
it's own laser printer initialization code separately stored on a file
(like PC MS Word that has a file called LASER.INIT that contains all
the PostScript definitions in it). Look and see if you can find such a
file in that Nota Bene thing. If yes, upload it and prepend it to your
PostScript code and shoot it to the laser printer. Otherwise, simply try
adding %!PS to the beginning of your existing PostScript file and see
if anything comes out at all. 

May the FORCE be with you.

>
>Any hint greatly appreciated.
>
>
>Margaret Mikulska
>systems administrator
>
>UC San Diego
>Dept. of ECE
>
>mmikulska@ucsd.edu
>MMIKULSKA@UCSD
>ucsd!mmikulska

Andy
-- 

_______________________________________________________________________________
Andy Sun                        | Internet: sun@me.utoronto.ca
University of Toronto, Canada   | UUCP    : csri.toronto.edu!me.utoronto.ca!sun
Dept. of Mechanical Engineering | BITNET  : sun@me.utoronto.BITNET

leoh@hardy.hdw.csd.harris.com (Leo Hinds) (03/16/90)

In article <7986@sdcsvax.UCSD.Edu> mikulska@odin.ucsd.edu (Margaret Mikulska) writes:
>One of our users has the following problem:
>
>He's using a word processor "Nota Bene" from Dragonfly on his PS/2, 
>under MS-DOS. The word processor creates a PostScript file which can
>be saved with the "print-to-disk" command. 	<text deleted>

We use microsoft word and ran into a similar problem.  The explanation from 
Microsoft was as follows (readers digest version):

1) print to file WILL NOT include the prologue file that would normally be 
   sent to the printer, if it were direct connected.

2) Microsoft assumes (because it has always been done that way with "word") 
   that the end user will MANUALLY sent the prolog file to the printer before 
   dumping the "save to file" output.

Notabene might be doing the same type of thing ...

leoh@hdw.csd.harris.com         	Leo Hinds       	(305)973-5229
Gfx ... gfx ... :-) whfg orpnhfr V "ebg"grq zl fvtangher svyr lbh guvax V nz n
creireg ?!!!!!!? ... znlor arkg gvzr

zben@umd5.umd.edu (Ben Cranston) (03/16/90)

In article <7986@sdcsvax.UCSD.Edu> mikulska@odin.ucsd.edu
(Margaret Mikulska) writes:

> ... using word processor "Nota Bene" from Dragonfly on PS/2 under MS-DOS.
> word processor creates PostScript file which can be saved with the
> "print-to-disk" command. [user] transfers file to a BSD-ish UNIX system
> to print it out on an Apple LaserWriter.
> file ... in some format that no printer (attached to a unix system) would
> print as is. ...didn't start with "%!"; the whole file 30,000 characters,
> was one single line (actually, 'wc' reported 0 lines)...

In article <1990Mar14.230311.26881@me.toronto.edu> sun@me.utoronto.ca
(Andy Sun Anu-guest) writes:

> ... symptoms that you mentioned (0 line) rings a bell. I had trouble
> printing a MacDraft PostScript output file to a laser printer hooked
> up to Unix before. I got the same 0 line business. It turned out that
> the software didn't generate a new line character at the end of a line.
> So when sent to Unix, no ^M at the end to wrap to a new line. Because of
> this, you end up having an ultra-long line (imagine ONE line with 30,000
> characters in it that even vi or wc fail to recognise it properly.

Newline on the Macintosh is ^M (CR) while newline on Unix is ^J (LF).
File transfer programs like Kermit or FTP change one to the other in order
to preserve the user-visible characteristics of the text.  If, however,
the file gets transfered in BINARY (IMAGE) mode this mapping does not get
done, and you see your data as one very long line.  The definition for a
"text file" on Berzerkeley is "LF delimited lines".  The vi and wc man pages
specifically say they work on "text files".  Your file, without any LFs
in it, is not a "text file", so action of vi/wc is undefined.

> What I did to overcome the problem was to write a tiny filter in C that
> adds a "\n" whenever it sees a "\0". This should bring the file back
> to normal. Last but not least, the word processor itself probably got
> it's own laser printer initialization code separately stored on a file
> (like PC MS Word that has a file called LASER.INIT that contains all
> the PostScript definitions in it). Look and see if you can find such a
> file in that Nota Bene thing. If yes, upload it and prepend it to your
> PostScript code and shoot it to the laser printer. Otherwise, simply try
> adding %!PS to the beginning of your existing PostScript file and see
> if anything comes out at all.

Postscript printers themselves do not need the %!, but some spooling systems
use this as a flag to distinguish postscript from running ASCII text.  This
makes it singularly difficult to get a listing of your Postscript program.
If you get a huge text listing full of things like

12 4.5 freeble
(Something you recognize) show
showpage

this is your problem, put the %! in.  Lack of the LASER.INIT-type prolog
file usually shows up as an undefined command, like this:

%%[ Error: undefined; OffendingCommand: foo ]%%
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%

I just sent a file containing only the word "foo" to a Laserwriter...

-- 

"It's all about Power, it's all about Control
 All the rest is lies for the credulous"
-- Man-in-the-street interview in Romania one week after Ceaucescu execution.