假设我的程序会产生几个图片,我想给用户提供一次性打印它们的选项。我不想为每一页显示“打印对话框”。因此,我只显示一次对话框,并仅对第一张图片进行显示。这是我目前想到的解决方案:
figHandles = get(0, 'Children');
for currFig = 1:length(figHandles)
if(currFig == 1)
printdlg(figHandles(currFig)); % Shows the print dialog for the first figure
else
print(figHandles(currFig)); % Does not show the print dialog and uses the latest printer selection
end
end
但问题在于,如果用户取消了第一张图的打印,我无法捕捉并取消其他的打印。我该怎么做才能解决这个问题呢?
eval
进行打印。 - Cheery