Code covered by the BSD License  

Highlights from
EPS Utility Toolbox

EPS Utility Toolbox

by

 

02 Mar 2012 (Updated )

A set of functions to generate publisher-happy EPS images

getgs()
function gsexe = getgs()
%GETGS   Get Path to the Ghostscript Executable

% Copyright 2012 Takeshi Ikuma
% History:
% rev. - : (03-02-2012) original release
% rev. 1 : (03-11-2012)
%          * Name changed from getgsexe.m -> getgs.m
%          * If failed to access Ghostscript, it now simply errors out

if ~ispref('epsutil','Ghostscript')
   error('EPS Utility Toolbox has not been setup. Please run EPSSETUP first.');
end

gsexe = getpref('epsutil','Ghostscript'); % executable path

% check to make sure that the Ghostscript program exists
[fail,msg] = system([gsexe ' -v']);
if fail || isempty(strfind(msg,'Ghostscript'))
   error('Ghostscript executable no longer exists. Please run EPSSETUP again.');
end

Contact us