Revert code for pdf/excel