Mercurial > hg > octave-lyh
diff scripts/plot/__fltk_print__.m @ 10864:d19d2abdd65f
__fltk_print__.m: When running pstoedit, crop eps file after it is created.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sat, 07 Aug 2010 13:47:52 -0400 |
parents | 337db4e1342d |
children | dd6b90f44ae5 |
line wrap: on
line diff
--- a/scripts/plot/__fltk_print__.m +++ b/scripts/plot/__fltk_print__.m @@ -149,15 +149,15 @@ devopt = opts.devopt; endif if (! isempty (opts.fig2dev_binary)) - cmd = sprintf ("%s -L %s %s %s 2>&1", opts.fig2dev_binary, devopt, figfile, devfile); + cmd = sprintf ("%s -L %s %s %s 2>&1", opts.fig2dev_binary, devopt, + figfile, devfile); [status, output] = system (cmd); - if (opts.debug) + if (opts.debug || status != 0) fprintf ("fig2dev command: %s", cmd) endif - if (status) + if (status != 0) + disp (output) warning ("print:fig2devfailed", "print.m: error running fig2dev.") - disp (cmd) - disp (output) endif elseif (isempty (opts.fig2dev_binary) && warn_on_absence) warning ("print:nofig2dev", "print.m: 'fig2dev' not found in EXEC_PATH.") @@ -173,21 +173,21 @@ if (nargin < 2) devopt = opts.devopt; endif + if (! isempty (opts.pstoedit_binary)) tmp_epsfile = strcat (tmpnam (), ".eps"); + drawnow ("eps", tmp_epsfile) if (opts.tight_flag) __tight_eps_bbox__ (opts, tmp_epsfile); endif - if (! isempty (opts.pstoedit_binary)) - drawnow ("eps", tmp_epsfile) - cmd = sprintf ("%s -f %s %s %s 2>&1", opts.pstoedit_binary, devopt, tmp_epsfile, name); + cmd = sprintf ("%s -f %s %s %s 2>&1", opts.pstoedit_binary, devopt, + tmp_epsfile, name); [status, output] = system (cmd); - if (opts.debug) + if (opts.debug || status != 0) fprintf ("pstoedit command: %s", cmd) endif - if (status) + if (status != 0) + disp (output) warning ("print:pstoeditfailed", "print.m: error running pstoedit.") - disp (cmd) - disp (output) endif [status, output] = unlink (tmp_epsfile); if (status != 0)