Download the PHP package ivoba/silverstripe-simple-pdf-preview without Composer
On this page you can find all versions of the php package ivoba/silverstripe-simple-pdf-preview. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ivoba/silverstripe-simple-pdf-preview
More information about ivoba/silverstripe-simple-pdf-preview
Files in ivoba/silverstripe-simple-pdf-preview
Package silverstripe-simple-pdf-preview
Short Description Simple Pdf Preview Extension for SilverStripe CMS
License MIT
Informations about the package silverstripe-simple-pdf-preview
silverstripe-simple-pdf-preview
Simple Pdf Preview Extension for SilverStripe CMS
Create Jpg Preview Images of Pdf files on the fly.
Install
Via Composer
Requirements
- SilverStripe 4 or 5
- you will need the Imagick extension.
For SilverStripe 3 use v1.
Usage
In your template just call where $Pdf is your File Object, containing a pdf file. You then have a normal Image object, on which you can apply all methods you usually can apply on an image in SilverStripe. F.e.:
If you call this method on a non-pdf file, null will be returned.
Config
You can override all Params in your config.yml.
You can create your own Generator class, simply implement . This could be the case, when we you dont want to use Imagick but ImageMagick directly via exec.
Tests
To run tests for bundle standalone:
start the docker container:
docker-compose run php bash
inside the container run:
SS_DATABASE_NAME=ss SS_DATABASE_PASSWORD=ss SS_DATABASE_SERVER=db SS_DATABASE_USERNAME=ss vendor/bin/phpunit
Disclaimer
This extension is "simple" because it will just create a loose Image object. Mapping happens over the filename. So its rather risky, but sufficient for most cases.
Somebody please make a better PDF extension, with a PDF File type, a PDF FileField and a preview image generation after upload. :)
License
The MIT License (MIT). Please see License File for more information.
All versions of silverstripe-simple-pdf-preview with dependencies
ext-imagick Version *
silverstripe/framework Version ^4||^5
silverstripe/asset-admin Version ^1.4||^2