changes to implement exporting to pdf