I have a method that receives as parameters 2 files in byte array format and its function is to join them in a single array. The problem is that when I try to open the resulting file the application tells me that the file is corrupt. The format of the files is word and the result too.
This is the code I have right now:
public static byte[] Combine(byte[] first, byte[] second)
{
byte[] ret = new byte[first.Length + second.Length];
Buffer.BlockCopy(first, 0, ret, 0, first.Length);
Buffer.BlockCopy(second, 0, ret, first.Length, second.Length);
return ret;
}
I have searched for a way to insert a page break between both block copies but I have not found it as.
Using the word interop library, I have solved it, but what I am trying to avoid is the dependency of this library for hosting issues of the webservices.
The reason for this question was that the word file obtained in the code above was not readable from the office application and asked for help to avoid the use of COM
Thanks in advance.