Opening PDF in a browser with Github Pages

后端 未结 8 1861
面向向阳花
面向向阳花 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:21

    You can link it this way

    PDF Doc

    Then, when you push to GitHub page, you will see your pdf file path as so

    https://userName.github.io/repoName/static/media/pdfFileName.hashNumber.pdf

    I believe it works if you import the file instead of using require as well but I haven't tested with that.

提交回复
热议问题