How to handle when API returns PDF binary stream

Viewed 203

I have an e-signature tool I'm using and when I want to download the executed file, it's a simple GET request. The issue is that it:

Returns PDF file binary stream of the document which you can save as PDF file.

When examining the file it looks something like this (this is only a snippet):

> r.body
 => "%PDF-1.4\n%\xE2\xE3\xCF\xD3\n77 0 obj\n<</ByteRange [0 141 16527 447870 ]                                                           /ContactInfo()/Contents <30820ffe06092a864886f70d010702a0820fef30820feb020101310f300d06096086480165030402010500300b06092a864886f70d010701a0820e393082042a30820312a00302010202043863def8300d06092a864886f70d01010505003081b431143012060355040a130b456e74727573742e6e65743140303e060355040b14377777772e656e74727573742e6e65742f4350535f3230343820696e636f72702e206279207265662e20286c696d697473206c6961622e2931253023060355040b131c286329203139393920456e74727573742e6e6574204c696d69746564313330310603550403132a456e74727573742e6e6574204365727469666963

What can I do with this data to present it on the screen as a PDF?

1 Answers
Related