[comp.os.os2.misc] Printing to a File: Answer and Question

lairdkb@mentor.cc.purdue.edu (Kyler Laird) (04/06/91)

Those of you who scan this newsgroup regularly have probably seen my requests
for help in printing to a file under OS/2.

Well, I didn't get any.

But I poked around and found what I had been hoping for all along.  It seems
that the spooler saves the .SPL files in a format ready to be sent directly
to the printer.  I had assumed that a more generic format would be used so
that multiple, different printers could service the same queue and each
receive the file in their own format.  I was wrong.

I was wanting to bring DOS up on a machine with a laser printer so I could
copy a .SPL file to floppy and copy it to the LPT: port of the DOS machine.
I didn't want to simply run it back through OS/2 since I figured it would
munge on it again and not give identical results as a DOS machine would.

It took me awhile, but I finally decided that OS/2 doesn't do any (?)
reformatting of print output from the DOS compat. box.  So I simply 'type'd
a .SPL file to LPT1:.  It worked!

What does this mean to you?

My original desire was to be able to print to a file which would later be
picked up by a FAX server on the network.  I'm still thinking of ways to
embed the FAX number in the .SPL or .SPD files.  I'd like to be able to use
the COMMENT field.  Regardless, now I can print to a file which is later
run through an Epson->DCX converter and FAXed.

Many publishers (me!) resist spending $50K+ on typesetting equipment.  Instead,
for their final prints they use a service bureau.  These businesses usually
take Postscript data (from disk or dialup).  Unfortunately, Ventura for OS/2
doesn't save to Postscript files.  With Ventura for Gem, I could select a
filename as my output device.  By capturing the .SPL file, I can duplicate
this function.

Problem:
I can't select NONE or any nonexistant physical port (LPT2:, LPT3: - haven't
wanted to bother with COM?:) for output of the printer driver.  This means
that I am forced to send to LPT1: after taking the printer off line. 

If I do select one of these ports, the application using the printer crashes
with an error.

Any ideas?

--kyler

d88-pfo@dront.nada.kth.se (Peter Forsberg) (04/07/91)

In article <9686@mentor.cc.purdue.edu> lairdkb@mentor.cc.purdue.edu (Kyler Laird) writes:

   But I poked around and found what I had been hoping for all along.  It seems
   that the spooler saves the .SPL files in a format ready to be sent directly
   to the printer.  I had assumed that a more generic format would be used so
   that multiple, different printers could service the same queue and each
   receive the file in their own format.  I was wrong.

I wouldn't rely on this always being the case (in future versions od OS/2 and/
or with other printer drivers.

   [Stuff deleted...]

   Many publishers (me!) resist spending $50K+ on typesetting equipment.  
   Instead,
   for their final prints they use a service bureau.  These businesses usually
   take Postscript data (from disk or dialup).  Unfortunately, Ventura for OS/2
   doesn't save to Postscript files.  With Ventura for Gem, I could select a
   filename as my output device.  By capturing the .SPL file, I can duplicate
   this function.

   Problem:
   I can't select NONE or any nonexistant physical port (LPT2:, LPT3: - haven't
   wanted to bother with COM?:) for output of the printer driver.  This means
   that I am forced to send to LPT1: after taking the printer off line.
   If I do select one of these ports, the application using the printer crashes
   with an error.

   Any ideas?

I would think that the best way to do this is to write an OS/2 device monitor,
which would be able to capture the raw output to the printer, just before it
goes out to the port. You could hook the monitor up for one of your non-
physical printer ports, let it dump the output to a file, and NOT pass it on
to the printer port (as you don't have any!).

I have written such a beast, which does some additional processing though,
and it wasn't at all that much work.

   --kyler

/ Peter Forsberg
--
_______________________________________________________________________________
Peter Forsberg 		      Royal Institute of Technology, Stockholm, Sweden.
Internet: d88-pfo@nada.kth.se
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

jfarley@pollux.svale.hp.com (Jens Farley) (04/09/91)

lairdkb@mentor.cc.purdue.edu (Kyler Laird) writes:

> Problem:
> I can't select NONE or any nonexistant physical port (LPT2:, LPT3: - haven't
> wanted to bother with COM?:) for output of the printer driver.  This means
> that I am forced to send to LPT1: after taking the printer off line. 

Forgive me if I'm pointing out the obvious, but all you have to do
is "hold" the queue while you're printing, use the .SPL file for
whatever you want to use it for, then delete the job before
"releasing" the queue.  You don't need a printer or even a parallel
port to pull this off.  Is this kind of what you were looking for?

Jens Farley
jfarley@pollux.svale.hp.com

goldman@mbcl.rutgers.edu (04/09/91)

In article <9686@mentor.cc.purdue.edu>, lairdkb@mentor.cc.purdue.edu (Kyler Laird) writes:
> Those of you who scan this newsgroup regularly have probably seen my requests
> for help in printing to a file under OS/2.
> 
> Well, I didn't get any.
> 
> But I poked around and found what I had been hoping for all along.  It seems
> that the spooler saves the .SPL files in a format ready to be sent directly
> to the printer.  I had assumed that a more generic format would be used so
> that multiple, different printers could service the same queue and each
> receive the file in their own format.  I was wrong.
> 
> I was wanting to bring DOS up on a machine with a laser printer so I could
> copy a .SPL file to floppy and copy it to the LPT: port of the DOS machine.
> I didn't want to simply run it back through OS/2 since I figured it would
> munge on it again and not give identical results as a DOS machine would.
> 
> It took me awhile, but I finally decided that OS/2 doesn't do any (?)
> reformatting of print output from the DOS compat. box.  So I simply 'type'd
> a .SPL file to LPT1:.  It worked!
> 
> What does this mean to you?
> 
> My original desire was to be able to print to a file which would later be
> picked up by a FAX server on the network.  I'm still thinking of ways to
> embed the FAX number in the .SPL or .SPD files.  I'd like to be able to use
> the COMMENT field.  Regardless, now I can print to a file which is later
> run through an Epson->DCX converter and FAXed.
> 
> Many publishers (me!) resist spending $50K+ on typesetting equipment.  Instead,
> for their final prints they use a service bureau.  These businesses usually
> take Postscript data (from disk or dialup).  Unfortunately, Ventura for OS/2
> doesn't save to Postscript files.  With Ventura for Gem, I could select a
> filename as my output device.  By capturing the .SPL file, I can duplicate
> this function.
> 
> Problem:
> I can't select NONE or any nonexistant physical port (LPT2:, LPT3: - haven't
> wanted to bother with COM?:) for output of the printer driver.  This means
> that I am forced to send to LPT1: after taking the printer off line. 
> 
> If I do select one of these ports, the application using the printer crashes
> with an error.
> 
> Any ideas?

	I thought that you could print to any file under os/2, simply by
inserting that in the list of known ports in the spooler program (eg file.nam).
Is this not true?
		- Adrian
> 
> --kyler
-- 
Adrian Goldman                         |  Internet:  Goldman@MBCL.Rutgers.Edu
Molecular Biology Computing Laboratory |  Bitnet:    Goldman@BioVAX
Waksman Insitute,                      |  Phone:     (908) 932-4864
Rutgers University,                    |  Fax:       (908) 932-5735
Piscataway, NJ 08855 USA               |