closes #33: factor out function 'comp_pdf' from 'saveGIF', 'saveLatex' and 'saveSWF'