2

I have a use case , where I want to view pdf files in Jekyll pages without downloading it.

For Example : Markdown is like

  • Heading 1
  • Heading 2
    • pdf view
  • Heading 3
    • pdf view

Can you suggest anything like iframe etc.. to embed in Jekyll pages


I have added below code into my jekyll md files to view pdf , It is working with images and other websites but not for pdf files.(the src path I defined was correct)

It is downloading the file rather than showing in the iframe.

<div class="pdf-container">
    <iframe src="{{ site.baseurl }}/assets/pdf/new.pdf" height="315" width="560" allowfullscreen="" frameborder="10">
    </iframe>
</div>
AHL
  • 493
  • 5
  • 8
  • I am talking about embed into an iframe rather than `link for a download`. – AHL Mar 13 '22 at 17:42
  • But images are displaying in the iframe correctly ;with a path `{{ site.baseurl }}/assets/new.pdf` ; I did not define them in a markdown text format ; I tryed your method it says `Error bad URI`. – AHL Mar 13 '22 at 17:55

0 Answers0