1

我有打印机页面,它将获取 .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()
4

1 回答 1

1

尝试用ms word打开文档并以microsoft wod格式再次保存,然后检查

相同的代码:

 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()
于 2012-11-28T15:54:51.073 回答