Languages
[Edit]
EN

Github - how to display raw PDF from github repository in web browser instead of download?

6 points
Created by:
Root-ssh
174740

1. Problem description

I have in github repository PDF and I'd like to display it in browser.

Is there a way to do it like with java file, when we display it as raw file it seems to work fine eg: 

https://raw.githubusercontent.com/dirask/dirask-tutorials/master/dirask-tutorials-java/src/main/java/com/dirask/Main.java

but when we do it with PDF file we are forced to downlaod it like this:

https://raw.githubusercontent.com/dirask/dirask-tutorials/master/dirask-tutorials-java/src/main/java/com/dirask/java_coding_convention/Java_Coding_Style_Guide.pdf

2. Solution

  1. We can solve this problem with Google Docs viewer
    https://docs.google.com/viewer?url=here_goes_link_to_our_github_raw_pdf_file
  2. Example

    https://docs.google.com/viewer?url=https://raw.githubusercontent.com/dirask/dirask-tutorials/master/dirask-tutorials-java/src/main/java/com/dirask/java_coding_convention/Java_Coding_Style_Guide.pdf
  3. Link from above example:

    https://docs.google.com/viewer?url=https://raw.githubusercontent.com/dirask/dirask-tutorials/master/dirask-tutorials-java/src/main/java/com/dirask/java_coding_convention/Java_Coding_Style_Guide.pdf

  4. Screenshot:

google docs viewer - display raw pdf file from github - https://dirask.com/q/PpqXnD
Google Docs viewer - display raw pdf file from github
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join