Mercurial > hg > octave-nkf
annotate scripts/plot/util/private/__ghostscript__.m @ 20092:65e6207f7ae4
Fix FLTK Edit uimenu to use new pan/rotate3d fcns and mousewheelzoom property.
* __add_default_menu__.m (__get_axes__): Return axes and figure handle.
* __add_default_menu__.m (guimode_cb): Use figure handle for pan and rotate.
Use new property mousewheelzoom.
author | Stefan Mahr <dac922@gmx.de> |
---|---|
date | Mon, 02 Mar 2015 14:51:23 +0100 |
parents | 9fc020886ae9 |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19880
diff
changeset
|
1 ## Copyright (C) 2010-2015 Ben Abbott |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
2 ## |
11104 | 3 ## This file is part of Octave. |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
10834 | 15 ## You should have received a copy of the GNU General Public License |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Function File} {} __ghostscript__ (@var{@dots{}}) | |
21 ## Undocumented internal function. | |
22 ## @end deftypefn | |
23 | |
24 ## Author: Ben Abbott <bpabbott@mac.com> | |
25 ## Created: 2010-07-26 | |
26 | |
11009 | 27 function [gs_cmd, cleanup_cmd] = __ghostscript__ (varargin); |
10834 | 28 |
19880
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
29 dos_shell = (ispc () && ! isunix ()); |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
30 |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
31 opts.binary = ""; |
11009 | 32 opts.source = "-"; |
33 opts.output = "-"; | |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
34 opts.device = ""; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
35 opts.epscrop = false; |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19930
diff
changeset
|
36 opts.antialiasing = false; |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14768
diff
changeset
|
37 opts.antialiasing_textalphabits = 4;, |
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14768
diff
changeset
|
38 opts.antialiasing_graphicsalphabits = 4; |
11009 | 39 opts.resolution = 150; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
40 opts.papersize = ""; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
41 opts.pageoffset = [0 0]; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
42 opts.debug = false; |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
43 opts.level = []; |
11009 | 44 opts.prepend = ""; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
45 |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
46 offsetfile = ""; |
11009 | 47 offset_ps = {}; |
48 cleanup_cmd = ""; | |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
49 |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
50 args = varargin; |
12931
cefd568ea073
Replace function handles with function names in cellfun calls for 15% speedup.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
51 n = find (cellfun ("isclass", args, "struct")); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
52 if (! isempty (n)) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
53 f = fieldnames (args{n}); |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14846
diff
changeset
|
54 for m = 1:numel (f) |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
55 opts.(f{m}) = args{n}.(f{m}); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
56 endfor |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
57 args(n) = []; |
10834 | 58 endif |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14846
diff
changeset
|
59 for n = 1:2:numel (args) |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
60 opts.(args{n}) = args{n+1}; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
61 endfor |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
62 |
11009 | 63 if (isempty (opts.papersize)) |
64 format_for_printer = false; | |
65 else | |
66 format_for_printer = true; | |
67 endif | |
68 | |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19930
diff
changeset
|
69 gs_opts = ["-dQUIET -dNOPAUSE -dBATCH -dSAFER -sDEVICE=" opts.device]; |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
70 |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
71 if (! isempty (opts.level) && ismember (opts.level, [1, 2, 3])) |
19930
5f2c0ca0ef51
Ensure that numbers passed to integer *printf format codes are integers (bug #44245).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
72 gs_opts = sprintf ("%s -dLanguageLevel=%d", gs_opts, opts.level); |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
73 endif |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
74 |
11009 | 75 if (opts.antialiasing && isempty (strfind (opts.device, "write"))) |
76 ## Apply anti-aliasing to all bitmap formats/devices | |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14768
diff
changeset
|
77 gs_opts = sprintf ("%s -dTextAlphaBits=%d -dGraphicsAlphaBits=%d", |
19930
5f2c0ca0ef51
Ensure that numbers passed to integer *printf format codes are integers (bug #44245).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
78 gs_opts, fix (opts.antialiasing_textalphabits), |
5f2c0ca0ef51
Ensure that numbers passed to integer *printf format codes are integers (bug #44245).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
79 fix (opts.antialiasing_graphicsalphabits)); |
5f2c0ca0ef51
Ensure that numbers passed to integer *printf format codes are integers (bug #44245).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
80 gs_opts = sprintf ("%s -r%dx%d", gs_opts, fix ([1, 1] * opts.resolution)); |
19765
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
81 elseif (any (strcmp (opts.device, {"pswrite", "ps2write", "pdfwrite"}))) |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
82 gs_opts = sprintf ("%s -dEmbedAllFonts=true", gs_opts); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
83 if (strcmp (opts.device, "pdfwrite")) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
84 ## Optimize for loading |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
85 gs_opts = sprintf ("%s -dOptimize=true", gs_opts); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
86 endif |
10834 | 87 endif |
88 | |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
89 if (opts.epscrop) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
90 ## papersize is specified by the eps bbox |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
91 gs_opts = sprintf ("%s -dEPSCrop", gs_opts); |
11009 | 92 endif |
93 if (format_for_printer) | |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
94 if (ischar (opts.papersize)) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
95 gs_opts = sprintf ("%s -sPAPERSIZE=%s", gs_opts, opts.papersize); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
96 elseif (isnumeric (opts.papersize) && numel (opts.papersize) == 2) |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10919
diff
changeset
|
97 gs_opts = sprintf ("%s -dDEVICEWIDTHPOINTS=%d -dDEVICEHEIGHTPOINTS=%d", |
19930
5f2c0ca0ef51
Ensure that numbers passed to integer *printf format codes are integers (bug #44245).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
98 gs_opts, fix (opts.papersize)); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
99 if (opts.papersize(1) > opts.papersize(2)) |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10919
diff
changeset
|
100 ## Lanscape mode: This option will result in automatic rotation of the |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10919
diff
changeset
|
101 ## document page if the requested page size matches one |
11009 | 102 ## of the default page sizes |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
103 gs_opts = sprintf ("%s -dNORANGEPAGESIZE", gs_opts); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
104 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
105 else |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11588
diff
changeset
|
106 error ("print:badpapersize", "__ghostscript__.m: invalid 'papersize'"); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
107 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
108 gs_opts = sprintf ("%s -dFIXEDMEDIA", gs_opts); |
11009 | 109 ## "pageoffset" is relative to the coordinates, not the BBox LLHC. |
110 str = sprintf ("%s [%d %d] %s", "<< /Margins [0 0] /.HWMargins [0 0 0 0] /PageOffset", | |
19930
5f2c0ca0ef51
Ensure that numbers passed to integer *printf format codes are integers (bug #44245).
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
111 fix (opts.pageoffset), ">> setpagedevice"); |
11009 | 112 offset_ps = {"%!PS-Adobe-3.0", str, "%%EOF"}; |
113 if (isfield (opts, "offsetfile")) | |
114 offsetfile = opts.offsetfile; | |
115 cleanup_cmd = ""; | |
116 else | |
19470
6ca096827123
Use tempname() rather than tmpnam() in core Octave.
Rik <rik@octave.org>
parents:
19047
diff
changeset
|
117 offsetfile = [tempname() ".ps"]; |
19880
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
118 if (dos_shell) |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
119 cleanup_cmd = ["del " strrep(offsetfile, '/', '\')]; |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
120 else |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
121 cleanup_cmd = ["rm " offsetfile]; |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
122 endif |
11009 | 123 endif |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
124 unwind_protect |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
125 fid = fopen (offsetfile, "w"); |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
126 if (fid == -1) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14774
diff
changeset
|
127 error ("print:fopenfailed", "__ghostscript__.m: fopen () failed"); |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
128 endif |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11588
diff
changeset
|
129 fprintf (fid, "%s\n", offset_ps{:}); |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
130 unwind_protect_cleanup |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
131 status = fclose (fid); |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
132 if (status == -1) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14774
diff
changeset
|
133 error ("print:fclosefailed", "__ghostscript__.m: fclose () failed"); |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
134 endif |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10854
diff
changeset
|
135 end_unwind_protect |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
136 if (opts.debug) |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11588
diff
changeset
|
137 fprintf ("---- begin %s ----\n", offsetfile); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11588
diff
changeset
|
138 fprintf ("%s\n", offset_ps{:}); |
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11588
diff
changeset
|
139 fprintf ("----- end %s -----\n", offsetfile); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
140 endif |
10834 | 141 endif |
142 | |
12460
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
143 if (isempty (opts.binary)) |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
144 error ("print:no_ghostscript", "__ghostscript__.m: ghostscript is required."); |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
145 elseif (isempty (opts.output)) |
11009 | 146 cmd = sprintf ("%s %s", opts.binary, gs_opts); |
147 else | |
14768
1c7956c661a8
Support spaces into the path to ghostscript.
Fabio Rossi <rossi.f@inwind.it>
parents:
14138
diff
changeset
|
148 cmd = sprintf ("%s %s -sOutputFile=\"%s\"", opts.binary, gs_opts, opts.output); |
11009 | 149 endif |
150 if (! isempty (opts.prepend) | |
19765
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
151 && any (strcmpi (opts.device, {"pswrite", "ps2write", "pdfwrite"}))) |
19047
7bbe3658c5ef
maint: Use "FIXME:" coding convention in m-files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
152 ## FIXME: Fonts get may be mangled when appending ps/ps2. |
7bbe3658c5ef
maint: Use "FIXME:" coding convention in m-files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
153 ## See "How to concatenate several PS files" at the link, |
7bbe3658c5ef
maint: Use "FIXME:" coding convention in m-files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
154 ## http://en.wikibooks.org/wiki/PostScript_FAQ |
11009 | 155 cmd = sprintf ("%s %s", cmd, opts.prepend); |
11014
92bb25c0da9e
When appending, delete temporary files at the end of the ghostscript pipeline.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
156 if (isempty (cleanup_cmd)) |
19880
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
157 if (dos_shell) |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
158 cleanup_cmd = ["del " strrep(opts.prepend, '/', '\')]; |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
159 else |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
160 cleanup_cmd = ["rm " opts.prepend]; |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
161 endif |
11014
92bb25c0da9e
When appending, delete temporary files at the end of the ghostscript pipeline.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
162 else |
19880
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
163 if (dos_shell) |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
164 cleanup_cmd = sprintf ("%s & del %s", cleanup_cmd, |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
165 strrep (opts.prepend, '/', '\')); |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
166 else |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
167 cleanup_cmd = sprintf ("%s ; rm %s", cleanup_cmd, opts.prepend); |
f1270e5a3117
__ghostscript__.m: Use del to remove files on Windows machines (bug #44186).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
168 endif |
11014
92bb25c0da9e
When appending, delete temporary files at the end of the ghostscript pipeline.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
169 endif |
11009 | 170 endif |
171 if (! isempty (offsetfile) && format_for_printer) | |
172 cmd = sprintf ("%s %s", cmd, offsetfile); | |
173 endif | |
174 if (! isempty (opts.source)) | |
175 cmd = sprintf ("%s %s", cmd, opts.source); | |
176 endif | |
10834 | 177 |
178 if (opts.debug) | |
11009 | 179 fprintf ("Ghostscript command: '%s'\n", cmd); |
10834 | 180 endif |
181 | |
11009 | 182 gs_cmd = cmd; |
10834 | 183 |
184 endfunction | |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
185 |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
186 |