5

I have a github webpage. How do I make a page displaying purely a pdf? I.e my cv?

To clarify, I wish the page to be filled only with the pdf - not any headings etc.

will hart
  • 51
  • 1
  • 2

5 Answers5

5

Just commit your pdf into your repo and it will be accessible just like any other file.

For instance, my resume is committed to my repo at https://github.com/xiongchiamiov/xiongchiamiov.github.com/blob/master/about/resume.pdf and is available on the web at https://changedmy.name/about/resume.pdf (I have a CNAME set up for changedmy.name).

Xiong Chiamiov
  • 13,076
  • 9
  • 63
  • 101
2

Rather than redirecting to the PDF, you could embed it using an iframe or something like https://github.com/mozilla/pdf.js.

This way, the PDF will be accessible within the page and you could prevent it from being downloaded without viewing it in the browser.

It's not possible to make the page display "purely" the pdf, as to do that, you would need to alter the response headers, which obviously isn't possible with github pages.

SteveEdson
  • 2,485
  • 2
  • 28
  • 46
  • Chrome has had a built-in PDF viewer for quite some time; has Mozilla not integrated pdf.js with Firefox yet? With one of those or a PDF-viewing plugin, visiting the pdf url directly will just display it, rather than forcing a download. – Xiong Chiamiov May 12 '16 at 18:33
1

You could have a JS redirect in your index.html that points to a pdf file that's also in your github-pages repo.

Suppose your file structure is like this:-

index.html
- cv(folder)
-----cv.pdf (your cv)

Then your code should look like this.

<html>
<body>

</body>
<script type="text/javascript">
    document.location = "robin.github.io/cv/cv.pdf"
</script>
</html>
  • Thanks, robin. So which file would I enter this code into? The index.html file? – will hart May 12 '16 at 11:41
  • I've uploaded cv2016.pdf to my cv folder. And in the cv folder's index file I have precisely entered the following code: But it doesn't seem to be working as I get a 404 page! Any suggestions to how to make this work? – will hart May 12 '16 at 12:05
  • Editing my answer. Give me a moment. – Robin Thuran Malhotra May 12 '16 at 13:13
0

You can also do this:

<html lang="fr">
<head>
<!-- note the meta tag -->
<meta http-equiv="refresh" content="0; url=http://yourprofile.github.io/cv.pdf" />
  <meta charset="utf-8">
  <title>Will CV</title>
</head>
<body>
</body>
</html>

See Redirect from an HTML page for more info.

Community
  • 1
  • 1
Christopher J.
  • 1,154
  • 1
  • 12
  • 21