How to print APP Window

조회 수: 23 (최근 30일)
Jeanne Parmentier
Jeanne Parmentier 2019년 7월 23일
편집: Austin B 2022년 1월 26일
Hello everyone,
I am creating a App in the App Designer to allow me import data, plot it in figures, add text, information etc. and I would like to export everything (figures + text) in a PDF.
I would like to print my app window like I was able to do when I used GUI figure in a PDF document, when a "PDF Export" button is pushed.
This is how it was working on GUI:
function pushbutton_PDF_Callback(hObject, eventdata, handles)
orient(GUI_Screen,'landscape');
print(GUI_Screen,'-fillpage', '-dpdf', 'GUI_Screen.pdf')
It would be a bit like a screenshot of the window, but I can't figure out how to do it!
Does anyone have a clue about it ?
Thanks!
  댓글 수: 1
Douglas Anderson
Douglas Anderson 2020년 4월 23일
If you are using Windows 10, just use the "Snipping Tool" (type Snipping Tool in the search window). That worked fine for me!

댓글을 달려면 로그인하십시오.

채택된 답변

Navya Seelam
Navya Seelam 2019년 7월 26일
Hi,
print functionality is not supported by App Designer. Moreover, figures created programmatically using UIFigure do not support save, load and savefig functions.
Possible workaround in your case is to create a pushbutton and create local handle to the figure in the callback for pushbutton. Assign the individual values of figure generated using UIFigure to the local figure and use saveas to save the local figure in pdf format as shown below.
h=figure;
a=app.UIAxes.XAxis.Parent.Children.XData;
b=app.UIAxes.YAxis.Parent.Children.YData;
plot(a,b);
saveas(h,'savename','pdf') ;
For more details on unsupported functionality in App Designer refer the following link
  댓글 수: 2
Jeanne Parmentier
Jeanne Parmentier 2019년 7월 29일
Hi, thanks for your answer!
Unfortunately, I do not want to save only the figure but the whole window with multiple figures and edit text, etc.
I will keep working on GUI then
Thanks again
Baha411
Baha411 2019년 10월 1일
Jeanne Parmentier Did you solve this problem with appdesigner?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Austin B
Austin B 2022년 1월 26일
편집: Austin B 2022년 1월 26일
For newcomers to this question, starting with R2020b is possible to print the app window to a pdf using the exportapp function. Adam Danz's answer to this question gives a lot of different ways to print UI figures and axes with different versions of MATLAB.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by