The first parameter of
FileStream
is a path to a file on the file system; not a base64-encoded string. If you already have the byte array for the file then you don't need to use a
FileStream
, but you could instead use a
MemoryStream Class (System.IO) | Microsoft Learn[
^]
Simple creating the
MemoryStream
instance, write the byte array, reset the position back to the beginning and pass it into the
Document
constructor. If the
Document
constructor does not take a
Stream
class then you might need to come up with a work-around.