Pdf should be created as soon as request is resolved

Hi team, 

we have requirement that pdf of particular record will be created for request/custom module

as soon as the ticekt stataus changed to resolved and get attached in the attchement of same ticket.