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
Place the PDF file in a folder like; www.website/pdf/example.pdf this will stop the file downloading outside of the root directory.
The steps are:
1. Create a new file in main directory.
2. Name file /pdf/ and save it.
3. Upload example.pdf file to this folder
Result:: PDF is viewable at; www.website/pdf/example.pdf
4. Optional step to avoid the .pdf URL. Create a index.html file in this folder and create a blank html file with PDF embed tag: