4

This is quite similar to what is being asked in this post, but the post does not seem to work for GitHub's parsed Markdown.

Simply put, let us say I have a PDF in a GitHub repository. Is there any way to render/embed that in a markdown file that is in the repository (e.g. the README.md file)?

I would also be open to having the PDF in a location other than GitHub and linking to it from the markdown file if that is what is required to make this work.

Gigi Bayte 2
  • 709
  • 7
  • 19
  • I think there is no way to directly render the pdf but you can embed pdf's image – atin Oct 25 '20 at 07:47
  • @at-in If the PDF could be embed, then that would work as well. – Gigi Bayte 2 Oct 25 '20 at 07:55
  • I did some more googling but didn't find any way to preview the pdf directly in readme but you can preview it in github pages – atin Oct 25 '20 at 11:19
  • And for readme or any other markdown file you can embed image of the pdf but not the pdf. – atin Oct 25 '20 at 11:21
  • I've added an answer stating the same things I said here. I'll update it if in future github provides a way to do this. – atin Oct 25 '20 at 11:28
  • Does this answer your question? [PDF to Github Flavored Markdown](https://stackoverflow.com/questions/19362931/pdf-to-github-flavored-markdown) – atin Nov 27 '20 at 14:46
  • @at-in Not quite. For the requirements given to me, it all had to be contained in the view of the Markdown file. So, I had to convert the PDF into a bunch of PNGs and put links to them in the markdown for previewing directly. – Gigi Bayte 2 Nov 27 '20 at 21:35
  • 1
    Oh then I don't think there is any other way to do this yet(?), I'll update this answer if I find anything :) – atin Nov 28 '20 at 02:41

1 Answers1

5

Currently there is no way to preview a pdf in github markdown, however you can embed an image of the pdf.

Edit
From here:

The best you can do is a greasemonkey extension which would allow you to call a pdf viewer, like the recent pdf.js (a Portable Document Format (PDF) viewer that is built with HTML5.), allowing you to view a pdf entirely online, without any pdf plugin installed.

atin
  • 953
  • 1
  • 9
  • 24