add pdf format to controller, config Middleware