Bug 696559

Summary: mswinpr2 needs dQueryUser to query windows printer settings
Product: Ghostscript Reporter: Nikolaus Kreuzer <nikolaus>
Component: Printer DriverAssignee: Ray Johnston <ray.johnston>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P4    
Version: master   
Hardware: PC   
OS: Windows 10   
Customer: Word Size: ---

Description Nikolaus Kreuzer 2016-01-31 07:19:37 UTC
when using a windows printer, e.g.
-sDEVICE=mswinpr2 -sOutputFile="%printer%MyPrinter"

the settings for this windows printer are ignored, unless you specify the additional argument
dQueryUser=3

if dQueryUser=1 or =2 a dialog pops up and to adjust the settings on the fly, but from my understanding 3 means "don't show an additional dialog" and therefore windows settings apply. From that point of view it is not understandable why windows printer settings (as format/orientation) are ignored when no argument dQueryUser is given. 

possible solution: 
if win_pr2_put_params has no "QueryUser", but sDevice=mswinpr2 AND sOutputFile is set, call 
  win_pr2_print_setup_interaction(wdev, 3);
Comment 1 Ray Johnston 2016-03-04 15:24:18 UTC
Fixed in commit 5cf300b7347c509f7530f5f9e7d6b0b997581f33

Thanks for the suggested method -- that seems to work OK.
Comment 2 Ray Johnston 2016-03-15 08:10:12 UTC
So, it seems that forcing querymode 3 ignores the %printer%___ and goes to
the default printer. Re-opening the bug to so we can get the right magic
sauce for windows to pick up the settings from the specified printer and
use them
Comment 3 Nikolaus Kreuzer 2016-04-13 06:52:55 UTC
You are right, unfortunately this is an issue for some customers. I would like to look into it, may I join the development?
Comment 4 Ray Johnston 2016-04-13 07:30:47 UTC
Nikolaus, of course you may work on this. Full source is available from our
web site, and it is simple to build with Visual Studio. I usually use either
VS 2008 or VS 2015. When you open the project it will convert the files
to whichever version you use (they are VS 2005 as distributed).

If you develop a patch and want us to include it in the distribution, you will
need to agree to the Artifex Contributor License agreement:
    http://bugs.ghostscript.com/attachment.cgi?id=9346
(this is stated on the "Add an attachment" page)
Comment 5 Ken Sharp 2021-10-09 15:09:29 UTC
I'm not clear on what the problem is here, so I'm closing it, it has been 5 years now.