added option for saving pdf file to disk