using standalone app designer how to print figure using pushbutton ,thanks .

61 Ansichten (letzte 30 Tage)
using standalone app designer need to using pushbutton to print figures.

Akzeptierte Antwort

m.montaser sabry
m.montaser sabry am 22 Sep. 2025 um 15:02

That is mean no hope with matlab R2021a Any way thanks a lot

  1 Kommentar
dpb
dpb am 22 Sep. 2025 um 15:55
Directly, apparently.
You could save the axis to a .pdf file with exportgraphics and then should be able to dump that file to a printer -- although that might also entail having to use an intermediary application.
Hadn't ever actually tried and the doc doesn't mention can't use print on uifigure and I had forgotten that even though did know it.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

dpb
dpb am 22 Sep. 2025 um 13:44
Bearbeitet: dpb am 22 Sep. 2025 um 15:57
Include print in the callback function of your button. You will have to inform your users that the printer will have to first be selected and configured by the OS user dialog method as printdlg won't work with AppDesigner and uiprintdlg wasn't introduced until R2025a so it won't be in R2021a.
ERRATUM
Can't use print on uifigure and I had forgotten that even though did know it, sorry.
You could save the axis to a .pdf file with exportgraphics and then should be able to dump that file to a printer -- although that might also entail having to use an intermediary application.
  17 Kommentare
dpb
dpb am 23 Sep. 2025 um 22:04
Bearbeitet: dpb vor etwa 15 Stunden
Agreed. Good luck...but one last thought/idea...
If you were to decide to pursue the printfile route, look at https://www.sumatrapdfreader.org/free-pdf-reader. While it is a reader/viewer, it has a command-line operation that would let you print programmatically like showed earlier with Adobe Reader. And, if you were really ambitious, you can download the source code and then could selectively compile the pieces needed only to do the printing stuff into a mex function wrapper so wouldn't have to distribute another executable. Your users wouldn't even be able to tell a file to be printed was created behind the scenes... <g>

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Printing and Saving finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by