数据库
首页 > 数据库> > C# 将数据库image类型的转成Pdf下载

C# 将数据库image类型的转成Pdf下载

作者:互联网

 byte[] mybyte = null;
                DataTable dt = OrderData.GetFP(txt.Text.Trim());
                mybyte = (byte[])dt.Rows[0]["PDF_FILE"];
                byte[] fileByte = Convert.FromBase64String(Convert.ToBase64String(mybyte));
                Response.Clear();
                Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}.pdf", txt.Text.Trim()));
                Response.BinaryWrite(mybyte);
                Response.Flush();
                Response.End();

 

标签:Convert,C#,image,dt,mybyte,Pdf,byte,txt,Response
来源: https://www.cnblogs.com/ZkbFighting/p/12800663.html