
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
eleventy-plugin-pdfembed
Advanced tools
This is an Eleventy plugin that creates a shortcode for Adobe's PDF Embed API.
This is an Eleventy plugin that creates a shortcode for Adobe's PDF Embed API. The PDF Embed API creates a web-based PDF viewer that gives you more control over the PDF experience in the browser compared to the built-in browser renderer. You can control the size, layout, and more using the API. (See the online demos for examples.)
In order to use this plugin, you must create a free set of credentials first.
To add the plugin to your Eleventy site, first install it:
npm i eleventy-plugin-pdfembed
Then add it to your .eleventy.js:
const pluginPDFEmbed = require('eleventy-plugin-pdfembed');
module.exports = (eleventyConfig) => {
// more stuff here
eleventyConfig.addPlugin(pluginPDFEmbed, {
key: '<YOUR CREDENTIAL KEY>'
});
}
Inside your templates, you can then use the shortcode like so:
{% pdfembed 'https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf' %}
The plugin requires, at minimum, the URL to your PDF document. It supports two additional parameters now. The first is mode, which defines how the PDF is embedded on the page. See the online demo for examples. Valid values are:
For example:
{% pdfembed 'https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf' 'LIGHT_BOX' %}
The third argument lets you customize the ID value used for the div tag. By default this is adobe-pdf-view, but you can set this to any valid ID:
<style>
#pdfdemo {
width: 500px;
height: 500px;
}
</style>
{% pdfembed 'https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf' 'IN_LINE' 'pdfdemo' %}
Feb 2, 2023 (1.0.2) - updated the script tag to use the modern viewer.
FAQs
This is an Eleventy plugin that creates a shortcode for Adobe's PDF Embed API.
We found that eleventy-plugin-pdfembed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.