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

3 views (last 30 days)
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 Comment
Moein Siadaty
Moein Siadaty on 6 Jan 2025
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

Sign in to comment.

Answers (1)

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

Categories

Find more on MATLAB Report Generator in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!