PHPackages                             redor/silverstripe-simple-pdf-preview - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. redor/silverstripe-simple-pdf-preview

ActiveSilverstripe-vendormodule[PDF &amp; Document Generation](/categories/documents)

redor/silverstripe-simple-pdf-preview
=====================================

Simple Pdf Preview Extension for SilverStripe CMS

0.0.2(3mo ago)01MITPHPPHP ^7.4 || ^8.0

Since Feb 1Pushed 3mo agoCompare

[ Source](https://github.com/redor303/silverstripe-simple-pdf-preview)[ Packagist](https://packagist.org/packages/redor/silverstripe-simple-pdf-preview)[ RSS](/packages/redor-silverstripe-simple-pdf-preview/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

silverstripe-simple-pdf-preview
===============================

[](#silverstripe-simple-pdf-preview)

Simple Pdf Preview Extension for SilverStripe CMS

[![Total Downloads](https://camo.githubusercontent.com/8d6b4011e819b5da9091daa17ffcf19eacd109c42e58f5675962db5a786a0159/68747470733a2f2f706f7365722e707567782e6f72672f69766f62612f73696c7665727374726970652d73696d706c652d7064662d707265766965772f646f776e6c6f6164732e706e67)](https://packagist.org/packages/ivoba/silverstripe-simple-pdf-preview)

Create Jpg Preview Images of Pdf files on the fly.

Install
-------

[](#install)

Via Composer

```
{
    "require": {
        "ivoba/silverstripe-simple-pdf-preview": "~2.0"
    }
}
```

Requirements
------------

[](#requirements)

- SilverStripe 4 or 5
- you will need the Imagick extension.

For SilverStripe 3 use v1.

Usage
-----

[](#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
------

[](#config)

You can override all Params in your config.yml.

```
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.

Tests
-----

[](#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
----------

[](#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
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/ivoba/silverstripe-simple-pdf-preview/blob/master/LICENSE) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 87% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

98d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b591c45c3b3333461043c57e75b0ac1719037dd0300140f1788268d6ecaabaa?d=identicon)[redor303](/maintainers/redor303)

---

Top Contributors

[![ivoba](https://avatars.githubusercontent.com/u/471254?v=4)](https://github.com/ivoba "ivoba (87 commits)")[![RVXD](https://avatars.githubusercontent.com/u/1586761?v=4)](https://github.com/RVXD "RVXD (4 commits)")[![redor303](https://avatars.githubusercontent.com/u/12527266?v=4)](https://github.com/redor303 "redor303 (3 commits)")[![BettinaMaria98](https://avatars.githubusercontent.com/u/50010683?v=4)](https://github.com/BettinaMaria98 "BettinaMaria98 (2 commits)")[![MauritzFunke](https://avatars.githubusercontent.com/u/12476814?v=4)](https://github.com/MauritzFunke "MauritzFunke (2 commits)")[![TheBnl](https://avatars.githubusercontent.com/u/1334195?v=4)](https://github.com/TheBnl "TheBnl (2 commits)")

---

Tags

pdfsilverstripecmspdf preview

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/redor-silverstripe-simple-pdf-preview/health.svg)

```
[![Health](https://phpackages.com/badges/redor-silverstripe-simple-pdf-preview/health.svg)](https://phpackages.com/packages/redor-silverstripe-simple-pdf-preview)
```

###  Alternatives

[silverstripe/cms

The SilverStripe Content Management System

5163.4M1.3k](/packages/silverstripe-cms)[bummzack/sortablefile

An extension for SilverStripe that adds sorting to UploadField.

70622.7k54](/packages/bummzack-sortablefile)[stevie-mayhew/hasoneedit

Allows editing the fields of a has\_one object directly in the CMS

21225.4k11](/packages/stevie-mayhew-hasoneedit)[symbiote/silverstripe-pdfrendition

A module that makes use of the Flying Saucer XHTML renderer project to create PDFs from XHTML pages.

175.0k](/packages/symbiote-silverstripe-pdfrendition)[enupal/snapshot

PDF or Image generation from a Url or HTML page

1137.9k](/packages/enupal-snapshot)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
