KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
export_fig.m
Go to the documentation of this file.
1 
2 
3 /* (Autoinserted by mtoc++)
4  * This source code has been filtered by the mtoc++ executable,
5  * which generates code that can be processed by the doxygen documentation tool.
6  *
7  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
8  * Except for the comments, the function bodies of your M-file functions are untouched.
9  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
10  * attached source files that are highly readable by humans.
11  *
12  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
13  * the correct locations in the source code browser.
14  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
15  */
16 
17 function [im , alpha ] = export_fig(varargin) {
18 drawnow;
19 /* Parse the input arguments */
20 [fig, options] = parse_args(nargout, varargin[:]);
21 /* Isolate the subplot, if it is one */
22 cls = all(ismember(get(fig, " Type "), [" axes ", " uipanel "]));
23 if cls
24  /* Given handles of one or more axes, so isolate them from the rest */
25  fig = isolate_axes(fig);
26 else
27  /* Check we have a figure */
28  if ~isequal(get(fig, " Type "), " figure ");
29  error(" Handle must be that of a figure, axes or uipanel ");
30  end
31  /* Get the old InvertHardcopy mode */
32  old_mode = get(fig, " InvertHardcopy ");
33 end
34 /* Hack the font units where necessary (due to a font rendering bug in
35  * print?). This may not work perfectly in all cases. Also it can change the
36  * figure layout if reverted, so use a copy. */
37 magnify = options.magnify * options.aa_factor;
38 if isbitmap(options) && magnify ~= 1
39  fontu = findobj(fig, " FontUnits ", " normalized ");
40  if ~isempty(fontu)
41  /* Some normalized font units found */
42  if ~cls
43  fig = copyfig(fig);
44  set(fig, " Visible ", " off ");
45  fontu = findobj(fig, " FontUnits ", " normalized ");
46  cls = true;
47  end
48  set(fontu, " FontUnits ", " points ");
49  end
50 end
51 /* MATLAB "feature": axes limits and tick marks can change when printing */
52 Hlims = findall(fig, " Type ", " axes ");
53 if ~cls
54  /* Record the old axes limit and tick modes */
55  Xlims = make_cell(get(Hlims, " XLimMode "));
56  Ylims = make_cell(get(Hlims, " YLimMode "));
57  Zlims = make_cell(get(Hlims, " ZLimMode "));
58  Xtick = make_cell(get(Hlims, " XTickMode "));
59  Ytick = make_cell(get(Hlims, " YTickMode "));
60  Ztick = make_cell(get(Hlims, " ZTickMode "));
61 end
62 /* Set all axes limit and tick modes to manual, so the limits and ticks can't change */
63 set(Hlims, " XLimMode ", " manual ", " YLimMode ", " manual ", " ZLimMode ", " manual ", " XTickMode ", " manual ", " YTickMode ", " manual ", " ZTickMode ", " manual ");
64 /* Set to print exactly what is there */
65 set(fig, " InvertHardcopy ", " off ");
66 /* Set the renderer */
67 switch options.renderer
68  case 1
69  renderer = " -opengl ";
70  case 2
71  renderer = " -zbuffer ";
72  case 3
73  renderer = " -painters ";
74  otherwise
75  renderer = " -opengl "; /* Default for bitmaps */
76 
77 end
78 /* Do the bitmap formats first */
79 if isbitmap(options)
80  /* Get the background colour */
81  if options.transparent && (options.png || options.alpha)
82  /* Get out an alpha channel
83  * MATLAB "feature": black colorbar axes can change to white and vice versa! */
84  hCB = findobj(fig, " Type ", " axes ", " Tag ", " Colorbar ");
85  if isempty(hCB)
86  yCol = [];
87  xCol = [];
88  else
89  yCol = get(hCB, " YColor ");
90  xCol = get(hCB, " XColor ");
91  if iscell(yCol)
92  yCol = cell2mat(yCol);
93  xCol = cell2mat(xCol);
94  end
95  yCol = sum(yCol, 2);
96  xCol = sum(xCol, 2);
97  end
98  /* MATLAB "feature": apparently figure size can change when changing
99  * colour in -nodisplay mode */
100  pos = get(fig, " Position ");
101  /* Set the background colour to black, and set size in case it was
102  * changed internally */
103  tcol = get(fig, " Color ");
104  set(fig, " Color ", " k ", " Position ", pos);
105  /* Correct the colorbar axes colours */
106  set(hCB(yCol==0), " YColor ", [0 0 0]);
107  set(hCB(xCol==0), " XColor ", [0 0 0]);
108  /* Print large version to array */
109  B = print2array(fig, magnify, renderer);
110  /* Downscale the image */
111  B = downsize(single(B), options.aa_factor);
112  /* Set background to white (and set size) */
113  set(fig, " Color ", " w ", " Position ", pos);
114  /* Correct the colorbar axes colours */
115  set(hCB(yCol==3), " YColor ", [1 1 1]);
116  set(hCB(xCol==3), " XColor ", [1 1 1]);
117  /* Print large version to array */
118  A = print2array(fig, magnify, renderer);
119  /* Downscale the image */
120  A = downsize(single(A), options.aa_factor);
121  /* Set the background colour (and size) back to normal */
122  set(fig, " Color ", tcol, " Position ", pos);
123  /* Compute the alpha map */
124  alpha = round(sum(B - A, 3)) / (255 * 3) + 1;
125  A = alpha;
126  A(A==0) = 1;
127  A = B ./ A(:,:,[1 1 1]);
128  clear B
129  /* Convert to greyscale */
130  if options.colourspace == 2
131  A = rgb2grey(A);
132  end
133  A = uint8(A);
134  /* Crop the background */
135  if options.crop
136  [alpha, v] = crop_background(alpha, 0);
137  A = A(v(1):v(2),v(3):v(4),:);
138  end
139  if options.png
140  /* Compute the resolution */
141  res = options.magnify * get(0, " ScreenPixelsPerInch ") / 25.4e-3;
142  /* Save the png */
143  imwrite(A, [options.name " .png "], " Alpha ", double(alpha), " ResolutionUnit ", " meter ", " XResolution ", res, " YResolution ", res);
144  /* Clear the png bit */
145  options.png= false;
146  end
147  /* Return only one channel for greyscale */
148  if isbitmap(options)
149  A = check_greyscale(A);
150  end
151  if options.alpha
152  /* Store the image */
153  im = A;
154  /* Clear the alpha bit */
155  options.alpha= false;
156  end
157  /* Get the non-alpha image */
158  if isbitmap(options)
159  alph = alpha(:,:,ones(1, size(A, 3)));
160  A = uint8(single(A) .* alph + 255 * (1 - alph));
161  clear alph
162  end
163  if options.im
164  /* Store the new image */
165  im = A;
166  end
167  else
168  /* Print large version to array */
169  if options.transparent
170  /* MATLAB "feature": apparently figure size can change when changing
171  * colour in -nodisplay mode */
172  pos = get(fig, " Position ");
173  tcol = get(fig, " Color ");
174  set(fig, " Color ", " w ", " Position ", pos);
175  A = print2array(fig, magnify, renderer);
176  set(fig, " Color ", tcol, " Position ", pos);
177  tcol = 255;
178  else
179  [A, tcol] = print2array(fig, magnify, renderer);
180  end
181  /* Crop the background */
182  if options.crop
183  A = crop_background(A, tcol);
184  end
185  /* Downscale the image */
186  A = downsize(A, options.aa_factor);
187  if options.colourspace == 2
188  /* Convert to greyscale */
189  A = rgb2grey(A);
190  else
191  /* Return only one channel for greyscale */
192  A = check_greyscale(A);
193  end
194  /* Outputs */
195  if options.im
196  im = A;
197  end
198  if options.alpha
199  im = A;
200  alpha = zeros(size(A, 1), size(A, 2), " single ");
201  end
202  end
203  /* Save the images */
204  if options.png
205  res = options.magnify * get(0, " ScreenPixelsPerInch ") / 25.4e-3;
206  imwrite(A, [options.name " .png "], " ResolutionUnit ", " meter ", " XResolution ", res, " YResolution ", res);
207  end
208  if options.bmp
209  imwrite(A, [options.name " .bmp "]);
210  end
211  /* Save jpeg with given quality */
212  if options.jpg
213  quality = options.quality;
214  if isempty(quality)
215  quality = 95;
216  end
217  if quality > 100
218  imwrite(A, [options.name " .jpg "], " Mode ", " lossless ");
219  else
220  imwrite(A, [options.name " .jpg "], " Quality ", quality);
221  end
222  end
223  /* Save tif images in cmyk if wanted (and possible) */
224  if options.tif
225  if options.colourspace == 1 && size(A, 3) == 3
226  A = double(255 - A);
227  K = min(A, [], 3);
228  K_ = 255 ./ max(255 - K, 1);
229  C = (A(:,:,1) - K) .* K_;
230  M = (A(:,:,2) - K) .* K_;
231  Y = (A(:,:,3) - K) .* K_;
232  A = uint8(cat(3, C, M, Y, K));
233  clear C M Y K K_
234  end
235  append_mode = [" overwrite ", " append "];
236  imwrite(A, [options.name " .tif "], " Resolution ", options.magnify*get(0, " ScreenPixelsPerInch "), " WriteMode ", append_mode[options.append+1]);
237  end
238 end
239 /* Now do the vector formats */
240 if isvector(options)
241  /* Set the default renderer to painters */
242  if ~options.renderer
243  renderer = " -painters ";
244  end
245  /* Generate some filenames */
246  tmp_nam = [tempname " .eps "];
247  if options.pdf
248  pdf_nam = [options.name " .pdf "];
249  else
250  pdf_nam = [tempname " .pdf "];
251  end
252  /* Generate the options for print */
253  p2eArgs = [renderer];
254  if options.colourspace == 1
255  p2eArgs = [p2eArgs [" -cmyk "]];
256  end
257  if ~options.crop
258  p2eArgs = [p2eArgs [" -loose "]];
259  end
260  try
261  /* Generate an eps */
262  print2eps(tmp_nam, fig, p2eArgs[:]);
263  /* Remove the background, if desired */
264  if options.transparent && ~isequal(get(fig, " Color "), " none ")
265  eps_remove_background(tmp_nam);
266  end
267  /* Add a bookmark to the PDF if desired */
268  if options.bookmark
269  fig_nam = get(fig, " Name ");
270  if isempty(fig_nam)
271  warning(" export_fig:EmptyBookmark ", " Bookmark requested for figure with no name. Bookmark will be empty. ");
272  end
273  add_bookmark(tmp_nam, fig_nam);
274  end
275  /* Generate a pdf */
276  eps2pdf(tmp_nam, pdf_nam, 1, options.append, options.colourspace==2, options.quality);
277  catch ex
278  /* Delete the eps */
279  delete(tmp_nam);
280  rethrow(ex);
281  end
282  /* Delete the eps */
283  delete(tmp_nam);
284  if options.eps
285  try
286  /* Generate an eps from the pdf */
287  pdf2eps(pdf_nam, [options.name " .eps "]);
288  catch ex
289  if ~options.pdf
290  /* Delete the pdf */
291  delete(pdf_nam);
292  end
293  rethrow(ex);
294  end
295  if ~options.pdf
296  /* Delete the pdf */
297  delete(pdf_nam);
298  end
299  end
300 end
301 if cls
302  /* Close the created figure */
303  close(fig);
304 else
305  /* Reset the hardcopy mode */
306  set(fig, " InvertHardcopy ", old_mode);
307  /* Reset the axes limit and tick modes */
308  for a = 1:numel(Hlims)
309  set(Hlims(a), " XLimMode ", Xlims[a], " YLimMode ", Ylims[a], " ZLimMode ", Zlims[a], " XTickMode ", Xtick[a], " YTickMode ", Ytick[a], " ZTickMode ", Ztick[a]);
310  end
311 end
312 return
313 
314 }
327 function [fig , options ] = exportfig>parse_args(nout,varargin) {
328 fig = get(0, " CurrentFigure ");
329 options = struct(" name ", " export_fig_out ", ...
330  " crop ", true, ...
331  " transparent ", false, ...
332  " renderer ", 0, ... /* 0: default, 1: OpenGL, 2: ZBuffer, 3: Painters */
333 
334  " pdf ", false, ...
335  " eps ", false, ...
336  " png ", false, ...
337  " tif ", false, ...
338  " jpg ", false, ...
339  " bmp ", false, ...
340  " colourspace ", 0, ... /* 0: RGB/gray, 1: CMYK, 2: gray */
341 
342  " append ", false, ...
343  " im ", nout == 1, ...
344  " alpha ", nout == 2, ...
345  " aa_factor ", 3, ...
346  " magnify ", 1, ...
347  " bookmark ", false, ...
348  " quality ", []);
349 native = false; /* Set resolution to native of an image */
350 
351 
352 /* Go through the other arguments */
353 for a = 1:nargin-1
354  if all(ishandle(varargin[a]))
355  fig = varargin[a];
356  elseif ischar(varargin[a]) && ~isempty(varargin[a])
357  if varargin[a](1) == " - "
358  switch lower(varargin[a](2:end))
359  case " nocrop "
360  options.crop= false;
361  case [" trans ", " transparent "]
362  options.transparent= true;
363  case " opengl "
364  options.renderer= 1;
365  case " zbuffer "
366  options.renderer= 2;
367  case " painters "
368  options.renderer= 3;
369  case " pdf "
370  options.pdf= true;
371  case " eps "
372  options.eps= true;
373  case " png "
374  options.png= true;
375  case [" tif ", " tiff "]
376  options.tif= true;
377  case [" jpg ", " jpeg "]
378  options.jpg= true;
379  case " bmp "
380  options.bmp= true;
381  case " rgb "
382  options.colourspace= 0;
383  case " cmyk "
384  options.colourspace= 1;
385  case [" gray ", " grey "]
386  options.colourspace= 2;
387  case [" a1 ", " a2 ", " a3 ", " a4 "]
388  options.aa_factor= str2double(varargin[a](3));
389  case " append "
390  options.append= true;
391  case " bookmark "
392  options.bookmark= true;
393  case " native "
394  native = true;
395  otherwise
396  val = str2double(regexp(varargin[a], " (?<=-(m|M|r|R|q|Q))(\d*\.)?\d+(e-?\d+)? ", " match "));
397  if ~isscalar(val)
398  error(" option %s not recognised ", varargin[a]);
399  end
400  switch lower(varargin[a](2))
401  case " m "
402  options.magnify= val;
403  case " r "
404  options.magnify= val ./ get(0, " ScreenPixelsPerInch ");
405  case " q "
406  options.quality= max(val, 0);
407  end
408  end
409  else
410  [p, options.name, ext] = fileparts(varargin[a]);
411  if ~isempty(p)
412  options.name= [p filesep options.name];
413  end
414  switch lower(ext)
415  case [" .tif ", " .tiff "]
416  options.tif= true;
417  case [" .jpg ", " .jpeg "]
418  options.jpg= true;
419  case " .png "
420  options.png= true;
421  case " .bmp "
422  options.bmp= true;
423  case " .eps "
424  options.eps= true;
425  case " .pdf "
426  options.pdf= true;
427  otherwise
428  options.name= varargin[a];
429  end
430  end
431  end
432 end
433 
434 /* Check we have a figure handle */
435 if isempty(fig)
436  error(" No figure found ");
437 end
438 
439 /* Set the default format */
440 if ~isvector(options) && ~isbitmap(options)
441  options.png= true;
442 end
443 
444 /* Check whether transparent background is wanted (old way) */
445 if isequal(get(ancestor(fig, " figure "), " Color "), " none ")
446  options.transparent= true;
447 end
448 
449 /* If requested, set the resolution to the native vertical resolution of the
450  * first suitable image found */
451 if native && isbitmap(options)
452  /* Find a suitable image */
453  list = findobj(fig, " Type ", " image ", " Tag ", " export_fig_native ");
454  if isempty(list)
455  list = findobj(fig, " Type ", " image ", " Visible ", " on ");
456  end
457  for hIm = list(:)^t
458  /* Check height is >= 2 */
459  height = size(get(hIm, " CData "), 1);
460  if height < 2
461  continue
462  end
463  /* Account for the image filling only part of the axes, or vice
464  * versa */
465  yl = get(hIm, " YData ");
466  if isscalar(yl)
467  yl = [yl(1)-0.5 yl(1)+height+0.5];
468  else
469  if ~diff(yl)
470  continue
471  end
472  yl = yl + [-0.5 0.5] * (diff(yl) / (height - 1));
473  end
474  hAx = get(hIm, " Parent ");
475  yl2 = get(hAx, " YLim ");
476  /* Find the pixel height of the axes */
477  oldUnits = get(hAx, " Units ");
478  set(hAx, " Units ", " pixels ");
479  pos = get(hAx, " Position ");
480  set(hAx, " Units ", oldUnits);
481  if ~pos(4)
482  continue
483  end
484  /* Found a suitable image
485  * Account for stretch-to-fill being disabled */
486  pbar = get(hAx, " PlotBoxAspectRatio ");
487  pos = min(pos(4), pbar(2)*pos(3)/pbar(1));
488  /* Set the magnification to give native resolution */
489  options.magnify= (height * diff(yl2)) / (pos * diff(yl));
490  break
491  end
492 end
493 return
494 
495 }
496 
497 function A = exportfig>downsize(A,factor) {
498 if factor == 1
499  /* Nothing to do */
500  return
501 end
502 try
503  /* Faster, but requires image processing toolbox */
504  A = imresize(A, 1/factor, " bilinear ");
505 catch
506  /* No image processing toolbox - resize manually
507  * Lowpass filter - use Gaussian as is separable, so faster
508  * Compute the 1d Gaussian filter */
509  filt = (-factor-1:factor+1) / (factor * 0.6);
510  filt = exp(-filt .* filt);
511  /* Normalize the filter */
512  filt = single(filt / sum(filt));
513  /* Filter the image */
514  padding = floor(numel(filt) / 2);
515  for a = 1:size(A, 3)
516  A(:,:,a) = conv2(filt, filt" , single(A([ones(1, padding) 1:end repmat(end, 1, padding)],[ones(1, padding) 1:end repmat(end, 1, padding)],a)), "valid^t);
517  end
518  /* Subsample */
519  A = A(1+floor(mod(end-1, factor)/2):factor:end,1+floor(mod(end-1, factor)/2):factor:end,:);
520 end
521 return
522 
523 }
524 
525 function A = exportfig>rgb2grey(A) {
526 A = cast(reshape(reshape(single(A), [], 3) * single([0.299; 0.587; 0.114]), size(A, 1), size(A, 2)), class(A));
527 return
528 
529 }
530 
531 function A = exportfig>check_greyscale(A) {
532 if size(A, 3) == 3 && ...
533  all(reshape(A(:,:,1) == A(:,:,2), [], 1)) && ...
534  all(reshape(A(:,:,2) == A(:,:,3), [], 1))
535  A = A(:,:,1); /* Save only one channel for 8-bit output */
536 
537 end
538 return
539 
540 }
541 
542 function [A , v ] = exportfig>crop_background(A,bcol) {
543 [h, w, c] = size(A);
544 if isscalar(bcol) && c > 1
545  bcol = bcol(ones(1, c));
546 end
547 bail = false;
548 for l = 1:w
549  for a = 1:c
550  if ~all(A(:,l,a) == bcol(a))
551  bail = true;
552  break;
553  end
554  end
555  if bail
556  break;
557  end
558 end
559 bail = false;
560 for r = w:-1:l
561  for a = 1:c
562  if ~all(A(:,r,a) == bcol(a))
563  bail = true;
564  break;
565  end
566  end
567  if bail
568  break;
569  end
570 end
571 bail = false;
572 for t = 1:h
573  for a = 1:c
574  if ~all(A(t,:,a) == bcol(a))
575  bail = true;
576  break;
577  end
578  end
579  if bail
580  break;
581  end
582 end
583 bail = false;
584 for b = h:-1:t
585  for a = 1:c
586  if ~all(A(b,:,a) == bcol(a))
587  bail = true;
588  break;
589  end
590  end
591  if bail
592  break;
593  end
594 end
595 /* Crop the background, leaving one boundary pixel to avoid bleeding on
596  * resize */
597 v = [max(t-1, 1) min(b+1, h) max(l-1, 1) min(r+1, w)];
598 A = A(v(1):v(2),v(3):v(4),:);
599 return
600 
601 }
602 
604 fh = fopen(fname, " r+ ");
605 if fh == -1
606  error(" Not able to open file %s. ", fname);
607 end
608 /* Read the file line by line */
609 while true
610  /* Get the next line */
611  l = fgets(fh);
612  if isequal(l, -1)
613  break; /* Quit, no rectangle found */
614 
615  end
616  /* Check if the line contains the background rectangle */
617  if isequal(regexp(l, " *0 +0 +\d+ +\d+ +rf *[\n\r]+ ", " start "), 1)
618  /* Set the line to whitespace and quit */
619  l(1:regexp(l, " [\n\r] ", " start ", " once ")-1) = " ";
620  fseek(fh, -numel(l), 0);
621  fprintf(fh, l);
622  break;
623  end
624 end
625 /* Close the file */
626 fclose(fh);
627 return
628 
629 }
630 
631 function b = exportfig>isvector(options) {
632 b = options.pdf || options.eps;
633 return
634 
635 }
636 
637 function b = exportfig>isbitmap(options) {
638 b = options.png || options.tif || options.jpg || options.bmp || options.im || options.alpha;
639 return
640 
641 /* Helper function */
642 }
643 
644 function A = exportfig>make_cell(A) {
645 if ~iscell(A)
646  A = [A];
647 end
648 return
649 
650 }
651 
652 function exportfig>add_bookmark(fname,bookmark_text) {
653 fh = fopen(fname, " r ");
654 if fh == -1
655  error(" File %s not found. ", fname);
656 end
657 try
658  fstrm = fread(fh, " *char ")^t;
659 catch ex
660  fclose(fh);
661  rethrow(ex);
662 end
663 fclose(fh);
664 
665 /* Include standard pdfmark prolog to maximize compatibility */
666 fstrm = strrep(fstrm, " %%BeginProlog ", sprintf(" %%%%BeginProlog\n/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse "));
667 /* Add page bookmark */
668 fstrm = strrep(fstrm, " %%EndPageSetup ", sprintf(" %%%%EndPageSetup\n[ /Title (%s) /OUT pdfmark ",bookmark_text));
669 
670 /* Write out the updated file */
671 fh = fopen(fname, " w ");
672 if fh == -1
673  error(" Unable to open %s for writing. ", fname);
674 end
675 try
676  fwrite(fh, fstrm, " char*1 ");
677 catch ex
678  fclose(fh);
679  rethrow(ex);
680 end
681 fclose(fh);
682 return
683 }
684 
function A = exportfig>check_greyscale(A)
Definition: export_fig.m:531
function [ A , v ] = exportfig>crop_background(A, bcol)
Definition: export_fig.m:542
A double value.
function b = exportfig>isbitmap(options)
Definition: export_fig.m:637
function [ im , alpha ] = export_fig(varargin)
Make sure the figure is rendered correctly now so that properties like axes limits are up-to-date...
Definition: export_fig.m:17
function fh = isolate_axes(ah, vis)
Make sure we have an array of handles.
Definition: isolate_axes.m:17
function print2eps(name, fig, varargin)
Definition: print2eps.m:17
function exportfig>add_bookmark(fname, bookmark_text)
Definition: export_fig.m:652
A variable number of input arguments.
function [ fig , options ] = exportfig>parse_args(nout, varargin)
Definition: export_fig.m:327
function [ A , bcol ] = print2array(fig, res, renderer)
Generate default input arguments, if needed.
Definition: print2array.m:17
Speed test * all(1:3)
function A = exportfig>rgb2grey(A)
Definition: export_fig.m:525
function A = exportfig>downsize(A, factor)
Definition: export_fig.m:497
function exportfig>eps_remove_background(fname)
Definition: export_fig.m:603
#define Y(i, j)
function eps2pdf(source, dest, crop, append, gray, quality)
Intialise the options string for ghostscript.
Definition: eps2pdf.m:17
function b = exportfig>isvector(options)
Definition: export_fig.m:631
function fh = copyfig(fh)
Set the default.
Definition: copyfig.m:17
function A = exportfig>make_cell(A)
Definition: export_fig.m:644
function pdf2eps(source, dest)
Construct the options string for pdftops.
Definition: pdf2eps.m:17