Rainmaker
Rainmaker

Reputation: 1241

Writing to complex PDF's in MATLAB

I'm trying to write a MATLAB function that processes a file and writes a report on that file. The report will contain numbers, strings, tables, and images.

After looking at MATLAB's documentation, I can only find functions that save individual items to a file. For example, print saves a plot, write saves a table, etc. How do I create a single file that contains many of these items (e.g. a PDF with images, tables, and text)?

Upvotes: 2

Views: 733

Answers (1)

A. Donda
A. Donda

Reputation: 8477

You can use print with the -append option to write multiple pages to a PostScript file in sequence, and then convert the ps to pdf. Using Matlab's handle graphics system, it is possible (if tedious) to design each print page in detail, arrange elements, etc.

However, if your document is going to be really complex, I think it would be better to generate the pdf in another way. One approach would be to write LaTeX code using lots of fprintfs and compile the file using pdflatex.

Btw., I'm not aware of a Matlab function write that generates a pdf.

Upvotes: 1

Related Questions