How do I generate a PDF report from a Microsoft Word Template using MATLAB Report Generator R2023a?
이전 댓글 표시
How can i generate a PDF report from Word Template?
I am able to create Word Report from a Word Template as follows:
d = Document('myReport','docx','Template.dotx');
open(d);
close(d);
How can I convert/generate it as a PDF file?
채택된 답변
추가 답변 (3개)
Sebastian Balthes
2020년 4월 22일
1 개 추천
Is there any other solution for this problem so far ?
I also wanna do it programmatically without running report explorer, because I need it for a standalone application.
Dominic Jarecki
2020년 6월 16일
편집: Dominic Jarecki
2020년 6월 16일
If you add the code:
rptview(d.OutputPath, 'pdf');
it will convert the .docx file to a .pdf. (Thus, you can proceed programatically as .dotx -> .docx -> .pdf, even in a deployed application.)
Unfortunately, this will also display the .pdf file as it is created, which may not be the intended behavior for a deployed application. I will update this post later if I find a way to hide the .pdf as it being created.
UPDATE: Turns out if you use docview(), you can avoid having anything display when you convert from .docx to .pdf:
docview('whateverYourFileHappensToBeNamed.docx','convertdocxtopdf','closeapp');
It is possible that this will not work on Linux (and maybe Mac); in any case, I haven't tested in those environments.
Dhanashree Mohite
2019년 4월 8일
0 개 추천
You can use report explorer to generate report for word document.
Use below command to open report explorer for that file:
>> setedit(filename)
refer below link for further steps:
카테고리
도움말 센터 및 File Exchange에서 Report Generator Creation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!