Save endpoint response of arraybuffer/bytestream into pdf?

Hi everyone,

Apologies for the newbie question, I know it may sound dumb so please bear with me. I’ve got an endpoint that returns a response with content-type: application/pdf that comes in byte array from java spring, and it is buffer/ arraybuffer when the postman/newman cli receives it.

when I preview it in postman app, it visualises to pdf, but if take the pm.response.toJson().stream.data, and decode into plain text it became lots encrypted and encoded text down below.

My goal is to save it as a proper pdf file then scrap the text from it to ensure the returned text in the pdf is what we actually want, or just simply decryt the buffer into plain text and make comparision.

I tried dannydainton’s post to save response into pdf, but that didn’t work for me, so would this be possible?

Screenshot 2023-07-07 165648