Hi all,
Please reply asap.
The control goes into infinite loop when i try reading pdf file in my C# file.

I have to return a string as it is my requirement.
can anyone suggest what to do?
FileStream ReadPdf = new FileStream(@"D:\abc.pdf", FileMode.Open);
long FileSize;
FileSize = ReadPdf.Length;
UTF8Encoding temp = new UTF8Encoding(true);
Int16 i;
string returnstring = null;
byte[] Buffer = new byte[(Int64)FileSize];
ReadPdf.Read(Buffer, 0, (int)ReadPdf.Length);
for (i = 0; i <= Buffer.Length - 1; i++)
{
returnstring = temp.GetString(Buffer);
}
return returnstring;