MATLAB Answers

How do I choose a printer from a list of printers in a stand alone application?

8 views (last 30 days)
How do I choose a printer from a list of printers in a stand alone application?
I would like to be able to have a user choose from a drop down list of printers in my compiler generated stand-alone application. I would like something similar to PRINTDLG. However, PRINTDLG is not supported in stand-alone mode.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
You can have a stand-alone application that will allow your user to select from a drop down list of printers by using the PRINT function. For example
surf(peaks) %create figure to be printed
print -dsetup %bring up the print dialogue box, select printer
print %print the figure with the new settings
If you are using DEPLOYPRINT then use the -v option:
surf(peaks) %create figure to be printed
if isdeployed
deployprint -v
else
print -dsetup %bring up the print dialogue box, select printer
print %print the figure with the new settings
end

More Answers (1)

Adam Jems
Adam Jems on 23 Oct 2018
Edited: Walter Roberson on 26 Feb 2020
To set a default printer in Windows first select the Start button > Then Settings. >Go to Devices > Printers & Scanners > select a printer > Manage.>Then select Set as default.if you did not set any default printer then your default can be the printer you last used in Windows 10. To turn on this mode, open Start and select Settings > Devices > Printers & Scanners.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!