2012-11-27 42 views
1

我有打印機頁面,它將得到.doc格式的二進制文件,然後打印出來頁面無法查看.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

iPad不知道如何閱讀word文檔。你期望會發生什麼? –

+0

我以前能夠在iPad上查看它,但格式是word文檔(.docx),但.doc它給了空白頁 – Athamneh

回答

1

嘗試打開在MS Word文檔,並重新保存 微軟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()