Ishara Lakshitha
Ishara Lakshitha

Reputation: 176

How to convert byte to PDF in xamarin forms

I received data from web services as byte I catch them in this property

   public byte[] Content { get; set; }

I have a web view to display the content of that byte. How to do this

is it need to convert to pdf or can these content directly called by the webview

Upvotes: 0

Views: 543

Answers (1)

user11639555
user11639555

Reputation:

string myFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "myFile.pdf");
System.IO.File.WriteAllBytes(myFilePath, Content);

Then like @Jason suggested, you can pass the myFilePath to your webview

Upvotes: 1

Related Questions