2017 © Pedro Peláez
 

silverstripe-module silverstripe-simple-pdf-preview

Simple Pdf Preview Extension for SilverStripe CMS

image

ivoba/silverstripe-simple-pdf-preview

Simple Pdf Preview Extension for SilverStripe CMS

  • Saturday, June 18, 2016
  • by ivoba
  • Repository
  • 1 Watchers
  • 6 Stars
  • 130 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 8 Versions
  • 7 % Grown

The README.md

silverstripe-simple-pdf-preview

Simple Pdf Preview Extension for SilverStripe CMS, (*1)

Total Downloads, (*2)

Create Jpg Preview Images of Pdf files on the fly., (*3)

Install

Via Composer, (*4)

``` json { "require": { "ivoba/silverstripe-simple-pdf-preview": "~2.0" } }, (*5)


## Requirements - SilverStripe 4 or 5 - you will need the Imagick extension. For SilverStripe 3 use v1. ## Usage In your template just call ```$Pdf.getPdfPreviewImage``` 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.: ```$Pdf.getPdfPreviewImage.Fill(60,60)``` If you call this method on a non-pdf file, null will be returned. ## Config You can override all Params in your config.yml. ``` yaml Ivoba\SilverStripe\SimplePdfPreview\SimplePdfPreviewImageExtension: dependencies: generator: %$Ivoba\SilverStripe\SimplePdfPreview\SimplePdfPreviewImagickGenerator folderToSave: "assets/someOtherFolder/" imagePrefix: "pdf-foobar" Injector: Ivoba\SilverStripe\SimplePdfPreview\SimplePdfPreviewImagickGenerator: class: Ivoba\SilverStripe\SimplePdfPreview\SimplePdfPreviewExecGenerator

You can create your own Generator class, simply implement SimplePdfPreviewGeneratorInterface. This could be the case, when we you dont want to use Imagick but ImageMagick directly via exec., (*6)

Tests

To run tests for bundle standalone:, (*7)

start the docker container:, (*8)

docker-compose run php bash

inside the container run:, (*9)

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., (*10)

Somebody please make a better PDF extension, with a PDF File type, a PDF FileField and a preview image generation after upload. :), (*11)

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

18/06 2016

dev-master

9999999-dev

Simple Pdf Preview Extension for SilverStripe CMS

  Sources   Download

MIT

The Requires

 

cms silverstripe pdf pdf preview

18/06 2016

1.1.1

1.1.1.0

Simple Pdf Preview Extension for SilverStripe CMS

  Sources   Download

MIT

The Requires

 

cms silverstripe pdf pdf preview

16/06 2016

1.1.0

1.1.0.0

Simple Pdf Preview Extension for SilverStripe CMS

  Sources   Download

MIT

The Requires

 

cms silverstripe pdf pdf preview

22/01 2015

1.0.4

1.0.4.0

Simple Pdf Preview Extension for SilverStripe CMS

  Sources   Download

MIT

The Requires

 

cms silverstripe pdf pdf preview

21/01 2015

1.0.3

1.0.3.0

Simple Pdf Preview Extension for SilverStripe CMS

  Sources   Download

MIT

The Requires

 

cms silverstripe pdf pdf preview

19/03 2014

1.0.2

1.0.2.0

Simple Pdf Preview Extension for SilverStripe CMS

  Sources   Download

MIT

The Requires

 

cms silverstripe pdf pdf preview

18/03 2014

1.0.1

1.0.1.0

Simple Pdf Preview Extension for SilverStripe CMS

  Sources   Download

MIT

The Requires

 

cms silverstripe pdf pdf preview

17/03 2014

1.0.0

1.0.0.0

  Sources   Download

The Requires