Windows Print-to-File

Black Hole

May contain traces of nut
I wonder if anyone has relevant experience to help me out here?

Each month I have a job to run off a club newsletter, which amounts to 5 A4 pages double-sided, 120-off. The printer I use for this has a paper tray that takes just over 100 sheets, and it can do double-sided printing, so I've worked out that the most efficient way to run the print job is in batches of 20 copies with collated printing (I can set it off and go do something else for 40 minutes before I have to refill the paper tray).

That's six batches of prints, each identical, that need firing off from the word processor that has the original loaded up.

I figured I could just run the print process once, and select the "print to file" option, then copy that file to the print queue six times. Sure enough, I get a .prn file (which is a hell of a lot bigger than the print batch spools to the print queue directly)... but then I can't figure out what to do with it.

Googling I see some command line options for sending a .prn file to a port, but this is a WiFi connected printer. I tried dragging and dropping the file onto the printer's queue, but after a lot of thinking the PC came up with "this operation needs the printer to be the default printer to complete this operation" (or words to that effect), which I didn't want. When I tried to do the same thing again, thinking it wouldn't do any harm to make it the default printer (why would it need to do that???), the operation bombed out anyway. It all seems rather a mess, and rather than persist with it any further I just went back to setting up the print batch fresh each time from the WP.

If anybody knows how to crack this I would love to hear. Vague suggestions not needed (I can google just the same as you).

Win 7.
 
If your default printer at the time you made the file had different printer attributes to the printer you want to print on (e.g. the default printer is an ink jet, but you are trying to use a laser printer) then the printer commands in the PRN file are probably all wrong. Regenerate the file with the printer you want to use as the default and I suspect things will come right.

My preference for doing what you are trying to do would be to have Word generate a PDF (the last 2/3 versions have this as a native option) and then print the PDF six times.
 

EEPhil

Number 28
I think it is likely you already have the best solution to this problem - repeat the print from inside the WP. It does seem to be a waste doing the print job 6 times - but trying to get printing to file and then copying to a port or network printer to work properly is a right pain in the lower regions.
Does repeating the print job waste too much time? If not, I'd use the method you know works. As someone once said: "if it ain't broke don't fix it".

If you really need to do it a different way then antipodean's idea of "print to PDF" (20 copies of original in one PDF) and then print this to printer 6 times might work - but I can see it requiring a bit of experimentation to find out if the page throws get screwed up. Also, printing to PDF might degrade any images you are using in the newsletter.
 
OP
Black Hole

Black Hole

May contain traces of nut
Doing things manually is error prone. To print from WP each time means having to fill in the number of copies box each time - the other print settings remain in place from the previous print, fortunately, but I have forgotten to change the number of copies from "1" sometimes!

I admit that it ain't exactly broke, but how much easier just to drag a print file into the printer queue?!!

I would get the point about the default printer if my print to file had used the default printer. It didn't - I used the print to file option in the settings for the target printer.

I suspect the answer is to work out exactly what the destination string should be in a command line binary copy - then I can build a .bat that does it six times on command - but it seems so obvious to be able to drag a file into the relevant print queue that I do not understand why Microsoft didn't think of it. The print queue isn't even a standard option on the "send to" list for .prn files!
 
I would get the point about the default printer if my print to file had used the default printer. It didn't - I used the print to file option in the settings for the target printer.

In my experience of Windows over many years I wouldn't trust Word to not still use the default settings.
 
OP
Black Hole

Black Hole

May contain traces of nut
I never said anything about Word, and the "print to file" option is in the print dialogue for the printer concerned. Give me some credit!
 

EEPhil

Number 28
Vague suggestions not needed (I can google just the same as you).
This might fall into that catagory - sorry in advance.

Have you looked into the command line item "lpr"? (You may have to look up installing Windows feature "LPR Port Monitor" in "Print and Document Services" for Win7 to get access to this command).I tested this on an old printer attached to another computer and it worked. If you do a google search on " windows copy to network printer" you will find details on site superuser.com. If your printer has a dedicated network address it might work.

In my case I printed a page to file -> test.prn
Then, in a command window:
lpr -S 192.168.1.1 -P EpsonLX -o l test.prn
... and it printed perfectly. This seems to be what you want. But will it work on a network printer?
Based on the google search - you might like to try something like...
lpr -S <your printer's IP> -P raw newsletter.prn
 
I never said anything about Word, and the "print to file" option is in the print dialogue for the printer concerned. Give me some credit!

But the print dialogue is opened by using the 'print' option in Word, is it not? My experience is that some of these 'features' seem to be there because Microsoft requires them of a driver, but they aren't necessarily well tested because they rarely get used.
 
OP
Black Hole

Black Hole

May contain traces of nut
This might fall into that catagory - sorry in advance.
I saw that kind of thing when I googled, although I think what I saw was more orientated towards sending to a comms port number. If I try that route I will have to investigate whether the assigned IP address is constant (I'm pretty sure I can find out what it is at any one time, just by looking on the printer's status screen). In any case, "LPR" looks like new info.
But the print dialogue is opened by using the 'print' option in Word, is it not? My experience is that some of these 'features' seem to be there because Microsoft requires them of a driver, but they aren't necessarily well tested because they rarely get used.
Stop talking about Word when you mean the WP. There are others you know (better, cheaper, easier to get fixed)!

Frankly, the Epson driver looks very full featured, and I have already tested quite a few of the options (2-up, double-sided... there's even an option to reverse the print order). Ticking the print-to-file box definitely produced a .prn file... if I can just send one small test print via a file it will prove that it really is for that printer.
 

EEPhil

Number 28
I saw that kind of thing when I googled, although I think what I saw was more orientated towards sending to a comms port number.

My (lack of) understanding makes me think that a comms port is required in Win7 if you want to lpr to a print queue on a Win7 computer. If you can't use lpr direct to the printer, you may be able to use it to 127.0.0.1 and the print queue (shared) name - but I think you'd have to investigate the setting up of comms ports for it to work. Command would look like my first example. (Un) fortunately I'm still using XP and the set up was easy.
 
Last edited:

Mike0001

Well-Known Member
Frankly, the Epson driver looks very full featured, and I have already tested quite a few of the options (2-up, double-sided... there's even an option to reverse the print order). Ticking the print-to-file box definitely produced a .prn file... if I can just send one small test print via a file it will prove that it really is for that printer.

Copy /b test.PRN \\printserver

Binary copy direct to the print server that appears in your network neighbourhood or in the epson setup.
 
OP
Black Hole

Black Hole

May contain traces of nut
Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

D:\My Documents\Newsletter>copy /b Newsletter.prn EP78163A:
"EP78163A:" is not a recognized device.
The system cannot find the file specified.

D:\My Documents\Newsletter>copy /b Newsletter.prn \\EPSON78163A
The specified path is invalid.
        0 file(s) copied.

D:\My Documents\Newsletter>copy /b Newsletter.prn \\192.168.1.66
The specified path is invalid.
        0 file(s) copied.

D:\My Documents\Newsletter>copy /b Newsletter.prn \\192.168.1.66\printer
The network name cannot be found.
        0 file(s) copied.

D:\My Documents\Newsletter>
"EP78163A:" is the port listed in the printer properties;
"EPSON78163A" is the name it has when DOpus scans the network for storage devices;
"192.168.1.66" is the IP address assigned in the router.

Now what?
 
OP
Black Hole

Black Hole

May contain traces of nut
Batch file:
Code:
@echo off
if "%1"=="" (set y=20) else (set y=%1)
for /l %%x in (%y%,-1,1) do echo %%x & lpr -S 192.168.1.66 -P raw Newsletter.prn

Yes, the IP address and the print file name are hard-coded, but that's probably good enough. Running the .bat on the command line defaults to 20 copies at a time (which is all I can do before the paper tray need refilling), or any number as a command parameter, and gives me a visual count-down of prints-to-go. I tried to make it do an audible alert at the end of the run with "echo ^G", but there was silence (probably because I have system sounds turned off). It may even run with a double click from Windows (defaulting to 20).

Anybody with ideas for improvement welcome to chip in - I don't claim to be a .bat guru.
 

prpr

Well-Known Member
"EPSON78163A" is the name it has when DOpus scans the network for storage devices;
"192.168.1.66" is the IP address assigned in the router.

Now what?
"net view \\EPSON78163A" or "net view \\192.168.1.66" should tell you the ShareName.
You can then map a printer to it e.g. "net use lpt1 \\EPSON78163A\ShareName" or the same with the IP address.
Or you could just use the UNC name/address directly without mapping.
 
OP
Black Hole

Black Hole

May contain traces of nut
I'll try that out of interest (in a month's time!), but the solution I have works so...

I suppose it could make the .bat independent of the IP address changing?
 
Top