Function File: [rc]=pdf_create()
: […]=pdf_create(nfig)
: […]=pdf_create(nfig, output_filename)
: […]=pdf_create(nfig, output_filename, width, height)
: […]=pdf_create(nfig, output_filename, width, height, delete_tmp_files)
: […]=pdf_create(nfig, output_filename, width, height, delete_tmp_files, single_pdf)

Creates a Pdf file from all figures listed in nfig

nfig … array of figure handles or character string "all"

output_filename … pdf file path

width … page width

height … page height

delete_tmp_files … if true, temporary files will be deleted

single_pdf … if true, write all figures to a single .pdf file

See also: pdf_merge.

Demonstration 1

The following code

 output_name = "";
 y = rand(3, 5);
 h = zeros(1, rows(y));
 unwind_protect
 output_name = tempname();
 for i=1:rows(y)
   h(i) = figure("visible","off");
   graphics_toolkit(h(i), "gnuplot");
   plot(y(i, :), sprintf("-;y%d;%d", i, i));
 endfor
 pdf_create(h, output_name);
 unwind_protect_cleanup
 if (numel(output_name))
   err = unlink([output_name, ".pdf"]);
   assert(err, 0);
 endif
 for i=1:numel(h)
  if(isfigure(h(i)))
   close(h(i));
  endif
 endfor
 end_unwind_protect

gives an example of how 'pdf_create' is used.

Package: mboct-octave-pkg