Add export to pdf function