Add export pdf function

make the export pdf funtion work