Convert pdf to Memory Stream in c#

public static MemoryStream ConvertPDFtoMemoryStream(string pdfUrl)
{
MemoryStream pdfMemoryStream;
WebClient client = new WebClient();
try
{
pdfMemoryStream =
new MemoryStream(client.DownloadData(HttpUtility.UrlDecode(pdfUrl)));
}
finally
{
client.Dispose();
}
return pdfMemoryStream;
}

Leave a comment