PHPackages                             ivoba/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. ivoba/silverstripe-simple-pdf-preview

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

ivoba/silverstripe-simple-pdf-preview
=====================================

Simple Pdf Preview Extension for SilverStripe CMS

3.0.0(2mo ago)68066MITPHPPHP ^8.3CI passing

Since Mar 17Pushed 2mo ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (20)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 6
- you will need the Imagick extension.

For SilverStripe 5 use v2.5. For SilverStripe 4 use v2.4. 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

56

—

FairBetter than 98% of packages

Maintenance84

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 90.5% 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 ~242 days

Recently: every ~290 days

Total

19

Last Release

80d ago

Major Versions

1.1.1 → 2.0.02019-07-27

2.5.0 → 3.0.02026-02-21

PHP version history (6 changes)1.0.0PHP &gt;=5.3.2

1.1.1PHP &gt;=5.4

2.0.0PHP &gt;=7.1.0

2.3.0PHP ^7.4 || ^8.0

2.5.0PHP ^8.1

3.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/a281e7f725fbe1ea8de5835c34e19c649afe33c2a1fbf48188ccff1274165fb1?d=identicon)[ivoba](/maintainers/ivoba)

---

Top Contributors

[![ivoba](https://avatars.githubusercontent.com/u/471254?v=4)](https://github.com/ivoba "ivoba (95 commits)")[![RVXD](https://avatars.githubusercontent.com/u/1586761?v=4)](https://github.com/RVXD "RVXD (4 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/ivoba-silverstripe-simple-pdf-preview/health.svg)

```
[![Health](https://phpackages.com/badges/ivoba-silverstripe-simple-pdf-preview/health.svg)](https://phpackages.com/packages/ivoba-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.7k55](/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)
