필터 지우기
필터 지우기

When using print for my gui I want it to work lige uiputfile, where the user can deside where to place the print.

조회 수: 1 (최근 30일)
Hey Matlab experts
I have a gui where I use the command print, to print my gui with all the information on it, into a pdf. Instead of it just printing a pdf and placing it next to where the gui is placed, then I want it to make a pop-up window like you get when using uiputfile, where the user can select where to place the pdf. How do I do that?
print(handles.output, '-dpdf', 'test1.pdf', '-r2000'); %What I originally used.
[FileName,PathName] = uiputfile('*.pdf','Save Print'); % This is what I tried 1/2
save([PathName,FileName],print(handles.output, '-dpdf', 'test1.pdf', '-r2000')); %2/2
  댓글 수: 1
Mikkel Ibsen
Mikkel Ibsen 2017년 11월 13일
The only thing I can find is the command:
movefile
But that isnt good coding, but more the lack of it and trying to solve a problem you dont understand.

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

채택된 답변

Cam Salzberger
Cam Salzberger 2017년 11월 13일
Hello Mikkel,
The print command does not provide an output argument - it is what is writing the file to disk. The save command should only be used when trying to save a MAT file, not when trying to write a PDF to disk.
What you can do instead is simply provide the full-path filename as the filename input argument to the print command:
[FileName,PathName] = uiputfile('*.pdf','Save Print');
print(handles.output, '-dpdf', fullfile(PathName, FileName), '-r2000')
Also, -r2000 is likely not necessary, as the PDF should be printed in vector format. Typically you would specify PaperPosition and/or PaperSize (or other paper properties) if you were concerned about the size on the PDF.
-Cam

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by