Convert EPS to Png using c#
-
Hi friends. I have a bit problem here. below code generate image from jpg to png but not working with eps.
protected void Page_Load(object sender, EventArgs e)
{
string path = Server.MapPath(Request.QueryString["Path"]);
byte[] by = FileToArray(path);
MemoryStream ms = new MemoryStream(by, 0, by.Length);
ms.Write(by, 0, by.Length);
System.Drawing.Image img = Bitmap.FromStream(ms);
// I am getting error in above line when reads eps file
// Error : Parameter is not valid
ms.WriteTo(Response.OutputStream);
}
public byte[] FileToArray(string sFilePath)
{
System.IO.FileStream fs = new System.IO.FileStream(sFilePath,
System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);
br.Close();
fs.Close();
return bytes;
}Thanks Regards kHan
please don't forget to vote on the post that helped you.
-
Hi friends. I have a bit problem here. below code generate image from jpg to png but not working with eps.
protected void Page_Load(object sender, EventArgs e)
{
string path = Server.MapPath(Request.QueryString["Path"]);
byte[] by = FileToArray(path);
MemoryStream ms = new MemoryStream(by, 0, by.Length);
ms.Write(by, 0, by.Length);
System.Drawing.Image img = Bitmap.FromStream(ms);
// I am getting error in above line when reads eps file
// Error : Parameter is not valid
ms.WriteTo(Response.OutputStream);
}
public byte[] FileToArray(string sFilePath)
{
System.IO.FileStream fs = new System.IO.FileStream(sFilePath,
System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);
br.Close();
fs.Close();
return bytes;
}Thanks Regards kHan
please don't forget to vote on the post that helped you.