Generate PDF by script

16 ビュー (過去 30 日間)
Mujtaba Farrukh
Mujtaba Farrukh 2021 年 12 月 31 日
コメント済み: Kevin 2022 年 1 月 1 日
Hi,
I want to generate the pdf file (not from pressing the publish button or by using the save as button) from script (.m or .mlx). Is there any way to do so?
Your reply would be appreciated.
Thanks in anticipation.
  7 件のコメント
Mujtaba Farrukh
Mujtaba Farrukh 2022 年 1 月 1 日
Sir, I need to convert the .mlx file (with its output evaluted and code) to pdf. I have used your guided method "publish", it works but for doc only. But as soon as I put pdf it says:
Error on line 25 column 91 of null:
Error reported by XML parser: An invalid XML character (Unicode: 0xffff) was found in the element content of the document.
Error using publish
.m file must contain valid XML 1.0 Standard characters.
Error in untitled (line 7)
publish('Out.mlx',options)
I have attached the files, you can have a try. Run the main file.
Mujtaba Farrukh
Mujtaba Farrukh 2022 年 1 月 1 日
So, now, I have commented the T1 and T4. The program runs fine and generate PDF too. But the thing is there is a lot of difference between publish button pdf and publish function pdf. Is there any way to get the same pdf as the button do

サインインしてコメントする。

採用された回答

Kevin
Kevin 2021 年 12 月 31 日
What about the MATAB function publish( )?
  2 件のコメント
Mujtaba Farrukh
Mujtaba Farrukh 2022 年 1 月 1 日
yes I have checked, it function can help me. But can I make a formated pdf file, like the one I attached, from the script?
I am attaching the .m file that I want to convert in a pdf.
Kevin
Kevin 2022 年 1 月 1 日
I believe the answer is yes. But in order to generate the PDF, you need MATLAB Report Generator (which is a toolbox).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeReporting and Database Access についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by