How to convert from string into pdf?
using (Stream stream = ... fetch the stream from somewhere)
{
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
File.WriteAllBytes("foo.pdf", buffer);
}
and if this RESTful service talks HTTP you could use a WebClient:
using (var client = new WebClient())
{
client.DownloadFile("http://example.com/api", "foo.pdf");
}