Implemented 'save as pdf' function.