Centering embed PDF content

前端 未结 1 1831
我寻月下人不归
我寻月下人不归 2021-01-16 19:22

I have a PDF file embed inside my web page. My HTML is:


My CSS is:

emb         


        
1条回答
  •  耶瑟儿~
    2021-01-16 19:41

    You can control the height and width via CSS like such:

    
    

    You also control it via attributes in the embed tag like such:

    
    

    As for the zoom, you can achieve this by doing the following (note the #zoom=75):

    
    

    This syntax worked in IE11 and FF32, but not in Chrome 38.


    Edit: Answer to the centering part of the question:

    Centering the PDF only fails in Chrome. A work around for this can be to replace the embed tag with an iFrame like such (though I don't think this is the best practice).

    
    

    Alternatively, you can look at some thing like pdf.js.

    0 讨论(0)
提交回复
热议问题