Is it possible to join pdf files with MATLAB?

조회 수: 18 (최근 30일)
Mr M.
Mr M. 2017년 12월 29일
편집: Franco Dave 2021년 11월 22일
Is it possible to join pdf outputs (plots or pictures/images) into a single pdf file with MATLAB?
  댓글 수: 4
Nickolas Blank
Nickolas Blank 2020년 9월 16일
type:
publish('my_first_script.m','pdf')
into your command window, of course using the title of your script in the my first script section and then it will merge any plots you have made with that script and that script into one single file.
Jennifer Toney
Jennifer Toney 2021년 8월 31일
how do you do that with 2 scritp files?

댓글을 달려면 로그인하십시오.

채택된 답변

Rik
Rik 2017년 12월 29일
I don't know an easy way with Matlab, but you can trivially solve this with pdfLaTeX. You can even build this file with Matlab.
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=-]{name_of_pdf_file1.pdf}
\includepdf[pages=-]{name_of_pdf_file2.pdf}
\end{document}
(the pages=- switch means that it will include all pages, not just the first)
Save this as a .tex file, install MikTeX (or any other package manager) and run pdflatex your_file_name.tex in your command prompt (or with system from Matlab)

추가 답변 (3개)

Jan
Jan 2017년 12월 29일
What are the inputs? Existing PDF files or a set of figures? For the latter, you can print to a PS file with the '-append' flag at first and use the free GhostScript to convert the PS to a PDF file. This is done e.g. in the famous export_fig also.
  댓글 수: 1
Mr M.
Mr M. 2018년 4월 5일
raster images, but I want to control the pdf image representation and compression

댓글을 달려면 로그인하십시오.


Nikhil Sapre
Nikhil Sapre 2021년 11월 10일
Release 2021b now supports exporting to a multipage pdf using the exportgraphics function

Abhishek Shahi
Abhishek Shahi 2021년 8월 31일
if you intend you merge several pdf files into one, use my code pdfmerge.

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by