フィルターのクリア

How do I convert a set of Microsoft Word Documents into a single PDF?

14 ビュー (過去 30 日間)
Pat Canny
Pat Canny 2022 年 10 月 3 日
編集済み: Pat Canny 2022 年 10 月 3 日
I have a set of Microsoft Word documents which I need to combine into a single PDF. How would I accomplish this in MATLAB?

採用された回答

Pat Canny
Pat Canny 2022 年 10 月 3 日
One way to do to this is to leverage the docview function from MATLAB Report Generator and the mergePDFs function created by Benjamin Großmann:
% Step 1: Find all Word Documents in local directory and convert to PDF
files = dir('*.docx');
for i=1:length(files)
file = files(i);
filename = file.name;
docview(filename,'convertdocxtopdf','closeapp');
end
% Step 2: Merge all PDFs in local directory into a single PDF
pdffiles = dir('*.pdf');
pdf_filenames = {pdffiles.name};
outputFileName = "combinedDocument.pdf";
mergePdfs(pdf_filenames, outputFileName); % requires mergePDFs Add On installation

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by