Convert binary data to PDF

Hi - I am trying to convert some binary data into PDF format using the below sequence but after the conversion, when I try to open the PDF I am getting an error that the file might be damaged. Would anyone know where I am going wrong here?

image

image