You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pdf2eps.m
    path of file: ./repos/gift/GroupICAT/icatb/toolbox/export_fig
    
    the code of the file until where you have to start completion: %PDF2EPS  Convert a pdf file to eps format using pdftops
%
% Examples:
%   pdf2eps source dest
%
% This function converts a pdf file to eps format.
%
% This function requires that you have pdftops, from the Xpdf suite of
% functions, installed on your system. This can be downloaded from:
% http://xpdfreader.com
%
% Inputs:
%   source - filename of the source pdf file to convert. The filename is
%            assumed to already have the extension ".pdf".
%   dest - filename of the destination eps file. The filename is assumed to
%          already have the extension ".eps".

% Copyright (C) Oliver Woodford 2009-2010, Yair Altman 2015-

% Thanks to Aldebaro Klautau for reporting a bug when saving to
% non-existant directories.

% 22/09/2018 - Xpdf website changed to xpdfreader.com

function pdf2eps(source, dest)
    % Construct the options string for pdftops
    options = ['-q -paper match -eps -level2 "
    
function converts a pdf file to eps format.
%
% This function requires that you have pdftops, from the Xpdf suite of
% functions, installed on your system. This can be downloaded from:
% http://xpdfreader.com
%
% Inputs:
%   source - filename of the source pdf file to convert. The filename is
%            assumed to already have the extension ".pdf".
%   dest - filename of the destination eps file. The filename is assumed to
%          already have the extension ".eps".

% Copyright (C) Oliver Woodford 2009-2010, Yair Altman 2015-

% Thanks to Aldebaro Klautau for reporting a bug when saving to
% non-existant directories.

% 22/09/2018 - Xpdf website changed to xpdfreader.com

function pdf2eps(source, dest)
    % Construct the options string for pdftops
    options = ['-q -paper match -eps -level2 "' source '" "' dest '"'];

    % Convert to eps using pdftops
    [status, message] = pdftops(options);

    % Check for error
    if status
        % Report error
        if isempty(message)
            error('Unable to generate eps. Check destination directory is writable.');
        else
            error(message);
        end