Im currently working in a rather old system where we have already implemented functions for getting the filepath to a pdf which we launch to view in a browser. My current task is to implement functionality for us to also launch a pdf in our new storage (azure blob) which i will recieve as a Byte[]
. I have a functioning version where i create a temporary pdf which i launch the same way as the older implementation and storage, but it is preferable if i could implement functionality where i do not have to create a physical copy of the pdf.
I have not gotten this to work sadly, does anyone have any idea if it is possible to save a pdf in memory without creating a physicla pdf file, or directly launch a byte[]
as a pdf to the browser?
I would love for it to work similar to this where i have a local pdf document, but without creating the document itself.
string app = @"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
string temp = "pdf as base64";
byte\[\] bytes = Convert.FromBase64String(temp);
System.IO.File.WriteAllBytes("newTest.pdf", bytes);
string path = Path.GetFullPath("newTest.pdf");
// whatever condition to launch
System.Diagnostics.Process.Start(app, path);