PHPackages                             mcguffin/pdf-renderer - 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. mcguffin/pdf-renderer

ActiveWordpress-plugin

mcguffin/pdf-renderer
=====================

WordPress plugin to convert PDFs to Images before uploading them

0.2.0(1y ago)41[6 PRs](https://github.com/mcguffin/pdf-renderer/pulls)GPL-3.0-or-laterJavaScriptPHP &gt;=7.4.33|^8

Since Aug 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mcguffin/pdf-renderer)[ Packagist](https://packagist.org/packages/mcguffin/pdf-renderer)[ RSS](/packages/mcguffin-pdf-renderer/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (8)Versions (9)Used By (0)

PDF Renderer
============

[](#pdf-renderer)

Convert PDF Files to Images in your browser when dropped into the media library.

Includes [Mozilla pdf.js](https://github.com/mozilla/pdf.js/) for browser pdf rendering.

[![Upload Dialog](.wporg/screenshot-1.png)](.wporg/screenshot-1.png)PDF-Contents: cc-by [Creative Commons](https://creativecommons.org/)

Installation
------------

[](#installation)

### Production

[](#production)

- Head over to [releases](../../releases)
- Download 'pdf-renderer.zip'
- Upload and activate it like any other WordPress plugin
- AutoUpdate will run as long as the plugin is active

#### Using composer

[](#using-composer)

```
composer require mcguffin/pdf-renderer

```

### For Development

[](#for-development)

- cd into your plugin directory
- $ `git clone git@github.com:mcguffin/pdf-renderer.git`
- $ `cd pdf-renderer`
- $ `npm install`
- $ `npm run dev`

Plugin API
----------

[](#plugin-api)

### Filter `pdf_renderer_image_width`

[](#filter-pdf_renderer_image_width)

Use this to overrule width of generated images. Uses the largest image width known to WP by default. (e.g. the Large size from Settings &gt; Media).

#### Example:

[](#example)

```
add_filter( 'pdf_renderer_image_width', function( $width ) {
	// never underestimate a good integer.
	return 12345;
});
```

### Filter `pdf_renderer_image_type`

[](#filter-pdf_renderer_image_type)

Type of generated images. Possible values are `image/png` and `image/jpeg`. default is `image/png`.
To override the JPEG-Quality you can use the WP Core filter `jpeg_quality`. The string `pdf_renderer` is passed as a second argument to `apply_filters()`.

#### Example:

[](#example-1)

```
// we want jpeg ...
add_filter( 'pdf_renderer_image_type', function( $type ) {
	return 'image/jpeg';
});
// ... and a specific treatment for PDFs.
add_filter( 'jpeg_quality', function( $quality, $context = '' ) {
	if ( 'pdf_renderer' === $context ) {
		// Everybody loves artifacts.
		return 1;
	}
	return $quality;
}, 10, 2);
```

Development
-----------

[](#development)

npm scripts:

- `npm run audit`: Run phpcs audit
- `npm run build`: Build css and js from sources
- `npm run dev`: Watch css and js source dirs
- `npm run dashicons`: Generate dashicons scss variables from source
- `npm run i18n`: generate `.pot` file
- `npm run rollback`: remove last commit (local and remote – use with caution!)
- `npm run test`: run unit tests against PHP 7.4 and 8.3
- `npm run test:edge`: run unit tests against PHP 8.3 only
- `npm run test:legacy`: run unit tests against PHP 7.4 only

Testing
-------

[](#testing)

### Unit Tests

[](#unit-tests)

Unit tests are run in [wordpress/env](https://www.npmjs.com/package/@wordpress/env/v/2.0.0), which is basically a docker container. [Docker Desktop](https://docs.docker.com/desktop/) is required.

Unit tests are run against PHP 7.4 (legacy) and 8.3 (edge).

**Run them all:**

```
npm run test
```

**Run edge tests only:**

```
npm run test:edge
```

**Configure edge test and run something in wp-cli in the docker container:**

```
npm run test:set-edge
npm run test:reset-env
wp-env run cli wp core version
> 6.7.1
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance41

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1223 days

Total

2

Last Release

495d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e32281e1b5f0cbc598ece29eae06589fc9ed6aeb4529f5dd927bf0641e42fa4?d=identicon)[mcguffin](/maintainers/mcguffin)

---

Top Contributors

[![mcguffin](https://avatars.githubusercontent.com/u/402988?v=4)](https://github.com/mcguffin "mcguffin (46 commits)")

---

Tags

media-librarypdf-rendererwordpress-plugin

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mcguffin-pdf-renderer/health.svg)

```
[![Health](https://phpackages.com/badges/mcguffin-pdf-renderer/health.svg)](https://phpackages.com/packages/mcguffin-pdf-renderer)
```

PHPackages © 2026

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