PDF Viewer using object tag not working for Edge

后端 未结 3 1818
谎友^
谎友^ 2021-01-12 17:34

I am trying to show a PDF document inline using the object tag - it works as expected in Chrome and Firefox but isn\'t working in Edge.

Sample Code:



        
3条回答
  •  既然无缘
    2021-01-12 18:05

    I replaced the value of the type attribute with text/html.

    
    

    This method works for Edge and IE11.
    The response of the request contains html :

    
    
        
            
        
    
    

    Edge and IE11 maybe check the response content and block it because it is not a pdf...
    The pdf is in the of the response.

    Set type to text/html in this situation works for me on this browsers :

    • Firefox
    • Chrome
    • IE11
    • Edge
    • Opera

    I don't try on Safari.

    I hope this answer has helped you and that my English did not bother you too much

    提交回复
    热议问题