How to write byte[](Source file is word) value to pdf.
Here is the code which i am using.
FtpWebRequest reqFTP;
strPath="ftp://1.1.1.1/Docs/word.doc";
strFileName="output.doc";
FileStream outputStream = new FileStream("C:/folder/" + Session.SessionID + "/" + strFileName, FileMode.Create);
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(strPath));
reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(strUname, strPassword);
reqFTP.Proxy = null;
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();
strExt = strFileName.Split('.');
long cl = response.ContentLength;
readCount = ftpStream.Read(buffer, 0, bufferSize);
while (readCount > 0)
{
outputStream.Write(buffer, 0, readCount);
readCount = ftpStream.Read(buffer, 0, bufferSize);
}
ftpStream.Close();
outputStream.Close();
response.Close();
byte[] source comes from the FtpWebRequest.GetResponseStream() source is word file..How to write the byte[] to pdf file.
I have tried the way which mentioned in this linkByte[] to Pdf, but when i try to open pdf it showing (Adobe reader could not open. because it is either not a supported file type or because the file has been damanged(for example, it was sent as an email attachment and wasn't correctly decoded)).
Thank You