A Directus extension to create a screenshot image for each uploaded PDF document.
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.
- Generate image from the first page from uploaded PDF files
- Store the generated image in PNG format in the Directus media library
To install this extension, add the package to your directus project by running the following command:
pnpm install @bicou/directus-extension-pdf-image
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.
To use this extension, simply upload a PDF file to your Directus instance. The extension will automatically generate an image from the PDF file.
This extension is released under the MIT License.