Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A version of the Windows "FILE:" port which does not prompt for the file name but autogenerates one

I have a process where one of the things to do is to capture the output from a print into a file for further processing. For this I have configured a "FILE:" printer port which works very nicely but asks everytime for the file name to use.

Unfortunately "FILE" is not a very descriptive word when trying to use a search engine :(

Is there a small driver somewhere which does exactly the same as the FILE: driver, but can automatically generate a filename (perhaps based on a pattern) and just print to that?

like image 454
Thorbjørn Ravn Andersen Avatar asked Dec 22 '22 03:12

Thorbjørn Ravn Andersen


2 Answers

On the printer properties, port tab, click "Add Port...", "Local port", "New Port..." and then enter a drive path and filename. e.g. "C:\temp\printjob.prn" then click ok, and ok. If you get access denied, use the "Run as admin..." and then select Properties, etc..

That will print the job to that specific filename every time. You can rename the result.

Sadly, you can't (apparently) use %TIME% or %RANDOM% to make a unique filename.

like image 86
James Newton Avatar answered Jan 13 '23 09:01

James Newton


Try Multi File Port Monitor. I have it connected to the Ghostscript PDF printer driver (which is just a PostScript driver). When the driver creates PostScript it gets piped into gswin32 which converts it into pdf. Each generated pdf is given a unique name. You could get the behaviour you require by not piping the data to an external program - that way you'll just get the unique file naming.

Multi File Port Monitor configuration

The 1.5.1 release has more options than the earlier version. Here's the configuration dialog for 1.5.1:

enter image description here

On my machine the User command text box contains this text:

"C:\Program Files\gs\gs9.21\bin\gswin64c.exe" -dBATCH -dSAFER -dNOPAUSE -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -dAutoRotatePages=/PageByPage -r600 -sOutputFile="%f" -
like image 44
Brian THOMAS Avatar answered Jan 13 '23 09:01

Brian THOMAS