Is there a way to run a file through a print driver without opening the application?
Ex: run a .docx file, without opening word, and save it to file?
To print a file from your terminal, use the lpr command.
The print command is used to print a file directly without using a Windows application that supports printing.
However, you can use the keyboard shortcut key Ctrl + P to open the print window on a PC or Command + P to open the print window on an Apple computer.
Since it is a .docx
-file Microsoft Word is probably the best program to do the task.
I would have a look at the [command line arguments] to Word:
Have a look at the following switches:
/q
, /n
, /mFilePrintDefault
and /mFileExit
(/q
and /n
explained in the page above, and /mXxxx
refers to macros. Have a look att google.)
Example:
WINWORD.EXE your_document.docx /mFilePrintDefault /mFileExit /q /n
The following page seems to explain how to convert it to PDF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With