Saving .pdf files works in Matlab Appdesigner, but not as a standalone app

5 次查看(过去 30 天)
I created a matlab function that creates a .pdf document at a certain filepath which I get through the function uiputfile. If I try the code in my application in the appdesigner, everything works just fine. But if I export the app as a standalone .exe file, nothing happens.
Here is the relevant part of the code:
filter = {'*.pdf'};
[file, path] = uiputfile(filter,'Bitte wählen Sie einen Speicherort aus',Name);
if(path == 0)
return;
end
file = erase(file, '.pdf');
if (isempty(AESZeiten)~=1 || isempty(VESZeiten)~=1)
Titel = ['Auflistung der Befunde im EKG-Signal' ' "' Dateiname '":' newline newline];
Test = [newline];
rpt = Document(fullfile(path,file),'pdf');
open(rpt);
append(rpt, Titel);
append(rpt,Test);
table = FormalTable({'Minuten', 'Befund';rptMatrix(:,1),rptMatrix(:,2)});
append(rpt, table);
close(rpt);
I think it could be some sort of writing rights error, because the file does not show up in the desired location but it does show up in the "fast acess" (dont really know how it is called in english) section of my windows explorer. If I try to click on it there it just says that an error occured while openening this file and it cant be found.
I would really appreciate some help, thank you.
  1 个评论
Moein Siadaty
Moein Siadaty 2025-1-6
Do you solve your problem? I have the same problem. at the app designer the .pdf report generation works well. but in the compiled app,the generated .pdf file size is zro kB

请先登录,再进行评论。

回答(1 个)

JOSE NICOLAS GONZALEZ GUATIBONZA
Hello,
Just put the line makeDOMCompilable(); at the beginning of the callback who invokes the report generator.

类别

Help CenterFile Exchange 中查找有关 MATLAB Report Generator 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by