change the export to word and pdf function but this version exist some errors to be fixed.