Function File: status = pdf_merge(input_filenames, output_filename, verbose)

Combine several Pdf files listed in input_filenames into a single file identified by output_filename. If one has many pdf files to be merged, pdf_merge is significantly faster than using the "-append" option of print.

input_filenames … cell array of strings containing input filenames

output_filename … char string containing the output filename

verbose … enable verbose output

See also: pdf_create,print.

Demonstration 1

The following code

 output_name = tempname();
 hnd = [];
 hnd(end + 1) = figure("visible", "off");
 sombrero();
 hnd(end + 1) = figure("visible", "off");
 peaks();
 for i=1:numel(hnd)
   fname{i} = sprintf("%s_%d.pdf", output_name, i);
   graphics_toolkit(hnd(i), "gnuplot");
   pdf_create(hnd(i), fname{i});
 endfor
 pdf_merge(fname, [output_name, ".pdf"]);
 [err] = unlink([output_name, ".pdf"]);
 assert(err, 0);

Produces the following figures

Figure 1 Figure 2

Package: mboct-octave-pkg