BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,I am losing formats when sending a syncfusion byte array to an network printer(e.g. the byte array has lost his font): Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socket.NoDelay = true; IPAddress ip = IPAddress.Parse(ip); IPEndPoint ipEndPoint = new IPEndPoint(ip, someport); socket.Connect(ipEndPoint); socket.Send(_temp); socket.Close();Syncfusion Stuff:... myfunc(){WordDocument word = new WordDocument();//... some code word.Save(myMemoryStream, FormatType.Docx);_temp= myMemoryStream.ToArray();word.Close();} How to solve this problem ?!Thanks
FileContentResult File(byte[] fileContents, string contentType, string fileDownloadName);)
using asp.net mvc) we need to add the contentType
like this for getting the right document for the client:
"application/pdf" ,excel:
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
word:
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
.
// Open Word document using FileStream. FileStream fileStream = new FileStream("input.docx", FileMode.Open); // Copy file stream to MemoryStream. MemoryStream memoryStream = new MemoryStream(); fileStream.CopyTo(memoryStream); // Gets byte array from memory stream of file. byte[] temp = memoryStream.ToArray(); |