我有打印机页面,它将获得.doc格式的二进制文件,然后将其打印
它在IE,Firfox,chroom上工作
但是当我试图在ipad上查看它时它给了我空页? 下面是代码:
Dim filepath() As Byte
filepath = Session(Request.QueryString("id"))
Response.ClearHeaders()
Response.ClearContent()
Response.AddHeader("content-disposition", "attachment;filename=""MyFile.doc""")
Response.AddHeader("Content-Description", "myfiles")
Response.AppendHeader("Content-Type", "application/msword")
Response.AppendHeader("Content-Transfer-Encoding", "binary")
Response.AppendHeader("Pragma", "public")
Response.AppendHeader("Cache-Control", "must-revalidate")
Response.BinaryWrite(filepath)
Response.Flush()
Response.End()
答案 0 :(得分:1)
尝试以ms字开启文档并再次保存 用microsoft wrod格式然后检查
相同的代码:
Dim filepath() As Byte
filepath = Session(Request.QueryString("id"))
Response.ClearHeaders()
Response.ClearContent()
Response.AddHeader("content-disposition", "attachment;filename=""MyFile.doc""")
Response.AddHeader("Content-Description", "myfiles")
Response.AppendHeader("Content-Type", "application/msword")
Response.AppendHeader("Content-Transfer-Encoding", "binary")
Response.AppendHeader("Pragma", "public")
Response.AppendHeader("Cache-Control", "must-revalidate")
Response.BinaryWrite(filepath)
Response.Flush()
Response.End()