working solution for downloading and recreating pdf file