/hugo-adobe-pdf-api-shortcode

Shortcode to use pdf embed api from Adobe

Primary LanguageHTMLBSD Zero Clause License0BSD

Hugo Adobe pdf api shortcode


Table of Contents


Intro

Hugo shortcode for use PDF Embed API from Adobe

For more info you can check the api docu

Install

  1. Clone the repo https://github.com/toniop99/hugo-adobe-pdf-api-shortcode

  1. Copy ./layouts/shortcodes/pdf.html to ./layouts/shortcodes in your Hugo project.

  1. Add adobe sdk to ypur page script html (scripts.html or footer.html)
    <script type="text/javascript" src="https://documentservices.adobe.com/view-sdk/viewer.js"></script>
  1. Create an api on adobe developer page

    • Create an account
    • Create a project
    • Copy the API KEY (CLIENT ID) to your config.yaml params.

    ClientId on config.yaml

How to use

In your Hugo website place the following shortcode in any of the markdown pages.

    {{< pdf fileName="test" url="/files/resume.pdf" type="IN_LINE" >}}

Parameters

  • url (required) : The relative location of the file.
  • fileName (optional): Name of the file. Default to url provided.
  • type (optional)<FULL_WINDOW, SIZED_CONTAINER, IN_LINE OR LIGHT_BOX>: How the pdf will be shown. Default to IN_LINE More info on Adobe API Doc

Examples

IN LINE

IN_LINE

LightBox

LIGHT_BOX