Save Live Script automatically as PDF
Show older comments
Hello everyone,
I have a problem!
I wrote a program for the calculation of test data in the App Designer. The test results of the test person should be given to them in a report. Since I do not have access to the report generator, I have compiled the results in a live script and output them. I have set the button on the right to "hide code" and to save I press "save" and then "export to pdf".
Since I would like to compile the program as a standalone program, I cannot press the buttons myself and save the live script as a PDF.
I already tried the following:
matlab.internal.liveeditor.executeAndSave (which ('Handout.mlx'));
matlab.internal.liveeditor.openAndConvert ('Handout.mlx', 'test.pdf');
Unfortunately, the code is always displayed there! But the design fits :-)
Is there another way to automatically save the LiveScript as PDF without code?
Accepted Answer
More Answers (2)
Sahithi Kanumarlapudi
on 18 Nov 2020
0 votes
Hi,
From your question I understand that you would like to store the output of a live script without the code. If that is what you are intending to do you can use the 'publish()' function to view the output in html format.
You can refer to the below link to find more info and examples on how to use publish function
Hope this helps!
1 Comment
Jana Pecke
on 19 Nov 2020
Pierre Harouimi
on 3 Apr 2023
pdffile = export("myscript.mlx","myconvertedpdffile.pdf")
2 Comments
Mukesh
on 26 Aug 2024
export from within the mlx file doesn't save/export the latest run output..
it is very frustrating.
Pierre Harouimi
on 26 Aug 2024
It is possible to save the latest run, by using:
currentDoc = matlab.desktop.editor.getActive;
currentDoc.save;
% And then hide the code if you want
export(matlab.desktop.editor.getActiveFilename,HideCode=true)
However, I wouldn't use neither save neither export within the file, except you don't have any other solution.
I'd use:
matlab.internal.liveeditor.executeAndSave('filename.mlx')
export('filename.mlx')
Categories
Find more on Scripts in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!