How to use command line to set a path for printing to a virtual printer? #4578
Replies: 1 comment
-
This is a long standing windows problem and nothing whatsoever to do with SumatraPDF so follow the history to grasp a good understanding of what you are trying. That is a "Feature" of Windows (other os?) "Virtual" printing. my answer on StackOverflow https://stackoverflow.com/a/74201010/10802527 "Print" is a variation of copy from port to port (before "print" it was copy file.prn to port.lpt#) With "Virtual" printers you need to assign a port before "copy to". This is actually very easy but MS do not simply allow that for say "Microsoft Print to PDF" I have several ports but each needs a name so print to "My Print to A4portrait.PDF" or "My Print to A3landscape.PDF" actually I will use "A4P" and "A3L" and each port will have its own "filename" like The alternative is to use a Virtual Printer that has its own Port Redirection Monitor to an Automated file naming. There are many for windows but avoid the older (Ghostgum) RedMon as it was not designed for Windows 10/11 see comments here https://superuser.com/a/1808030/1769247 |
Beta Was this translation helpful? Give feedback.
-
SumatraPDF.exe -print-to "Microsoft Print to PDF" -print-settings 1-2,4,shrink,duplexshort,1x C:\2.PDF
The command above show a dialog to choose a path to save the new pdf file,How to assign a path in command line?
Beta Was this translation helpful? Give feedback.
All reactions