@bicou/directus-extension-pdf-image

0.0.4 • Public • Published

Directus Extension: PDF Image

npm version npm downloads npm license

A Directus extension to create a screenshot image for each uploaded PDF document.

Description

This extension uses the pdf-to-img library to generate an image from uploaded PDF files. It is designed to work seamlessly with Directus, a headless CMS.

Features

  • Generate image from the first page from uploaded PDF files
  • Store the generated image in PNG format in the Directus media library

Installation

To install this extension, add the package to your directus project by running the following command:

pnpm install @bicou/directus-extension-pdf-image

Dependencies

The pdf-to-img package depends on the canvas library, which in turn requires a cairo installation.

Due to this dependency, this extension will not function in a Directus Marketplace installation.

If you encounter installation or usage issues, please verify that canvas is correctly installed or consult the canvas documentation for further assistance.

Usage

To use this extension, simply upload a PDF file to your Directus instance. The extension will automatically generate an image from the PDF file.

Play screencast

License

This extension is released under the MIT License.

Package Sidebar

Install

npm i @bicou/directus-extension-pdf-image

Weekly Downloads

6

Version

0.0.4

License

MIT

Unpacked Size

5.13 kB

Total Files

4

Last publish

Collaborators

  • bicou