converting a string stream into pdf and return as a response to the client

255 Views Asked by At

I am working on a restful service using Web API 2 upon calling the get method, should return a pdf as a response.

I have the below method which returns a string, but I would like to convert the string to pdf and send it as a respose

        [HttpGet] 
        [Route("api/PDF/{ac_number}/{year}")] 
        public string GetPDF(string ac_number, string year) 
        {                 
            string res=_objService.CallAccountSearch(ac_number, year); 
            return res;
        }

In the above, instead of returning string, How would I convert it to PDF response?

0

There are 0 best solutions below