Cusomize PDF Download from the API

I will provide a formal step process solution. By the end of the week.

Looks like you’re using System.IO to fetch a file but you need to use an HTTP Client.

I’m assuming you’re using .NET as well. I see you fixed it, but this method is a sample for actually getting the Stream from a URI:

    public async Task<Stream> GetFileStreamFromUriAsync(string fileUri)
    {
        var response = await _httpClient.GetAsync(fileUri, HttpCompletionOption.ResponseHeadersRead);
        response.EnsureSuccessStatusCode();
        return await response.Content.ReadAsStreamAsync();
    }
1 Like