Opening PDF in a browser with Github Pages

后端 未结 8 1702
面向向阳花
面向向阳花 2021-01-31 09:48

I am using GitHub Pages to host my website. I have a PDF file that I want visitors to be able to open directly in a browser. But when I upload the PDF file to GitHub Pages and l

8条回答
  •  一生所求
    2021-01-31 10:37

    I have gone through most of the answers in this section however most of them are hard to figure out or too vague to understand what is happening. There is a simpler way to do this, so in order to display a Pdf file in a browser from Github here is the process:

    Step 1: Make the static website/repository using your Github username for example, if the username is winterishere then repository would be winterishere.github.io

    Step 2: Put the desired pdf in that repository and add an index.html file in the same location as the pdf file eg: resume.pdf.

    Step 3: Open the index.html and add the embed tag to it below:

    
    

    in my example the file the code would be:

     
    

提交回复
热议问题