Jekyll plugin for embedding PDF files to any page or post

Ruby


Jekyll PDF Embed is a ruby gem for Jekyll static site generator. It allows user to easily embed external or local PDF files to any page or blog post.

Installation

Add this line to your Gemfile:

group :jekyll_plugins do
  gem "jekyll-pdf-embed"
end

And then execute:

$ bundle

Alternatively install the gem yourself as:

$ gem install jekyll-pdf-embed

and put this in your _config.yml

plugins:
  - jekyll-pdf-embed

Usage

You can use external PDF files


 {% pdf "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" %}

or local


 {% pdf "/files/pdf/sample.pdf" %}

Use no_link to hide link to pdf file (‘View PDF’ header)


 {% pdf "/files/pdf/sample.pdf" no_link %}

You can also embed PowerPoint presentations!


 {% pdf "http://img.labnol.org/di/PowerPoint.ppt" %}

Your file must end with .pdf or .ppt. Everyting else is forbidden.

Result

The embedded pdf output

PDF output without link

PowerPoint presentation