My program needs to print a curve; my solution is changing the curve into a picture, and this picture file (xxx.png) can be printed by using the default windows picture printing tool (right click the mouse on top of the file, and select print).
but I don't want user do this job manually, I need a command line tool to do this:
printPicture xxx.png
How can I do this in command line?
To print a document on the default printer, just use the lp command followed by the name of the file you want to print.
The print command is used to print a file directly without using a Windows application that supports printing. Specifies the name of the Windows server on which the z/OS printer was defined as a Windows shared printer. The Windows server can be your own Windows system or a different Windows system.
To open a picture from terminal, To open any file via terminal, you have to locate the path of that file. Then type the name of the application which you want to open the file with. Save this answer.
I finally found out!
use windows image and fax viewer.
rundll32 shimgvw.dll ImageView_PrintTo /pt xxx.png "printer name"
This link had a simpler solution:
mspaint /pt [image filename]
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