PHPackages                             kodebyraaet/prince - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kodebyraaet/prince

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

kodebyraaet/prince
==================

Simple prince wrapper for Prince library

0.0.7(6y ago)31.9k4[1 PRs](https://github.com/Kodebyraaet/prince/pulls)PHPPHP &gt;=5.3.0

Since Mar 8Pushed 5y ago9 watchersCompare

[ Source](https://github.com/Kodebyraaet/prince)[ Packagist](https://packagist.org/packages/kodebyraaet/prince)[ RSS](/packages/kodebyraaet-prince/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

Laravel PrinceXML Wrapper
=========================

[](#laravel-princexml-wrapper)

Laravel PrinceXML Wrapper is a Laravel 4.2 package that wraps around the  PDF generator.

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

[](#installation)

There's a requirement to have the "prince" executable installed.

```
Install the "prince" executable from http://www.princexml.com/download/.

```

Run the following command to add Kodebyraaet/Prince to download and install.

```
composer require kodebyraaet/prince

```

Add the following .env variable to your .env.\*.php.

```
PRINCE_EXECUTABLE_PATH=/path/to/prince

```

Add the following to your app.php file in the service provider and alias sections respectively. The alias/facade is optional.

```
'Kodebyraaet\Prince\PrinceServiceProvider',
'Prince'            => 'Kodebyraaet\Prince\Facades\Prince',

```

Usage
=====

[](#usage)

The Kodebyraaet\\Prince\\Prince class is bound in the Laravel IoC as a Kodebyraaet\\Prince\\PrinceInterface, so everywhere the IoC automatically resolves dependencies (ie. in controllers) this is the preferred way to use Prince. Optionally you can also use $app-&gt;make(...) or App::make(...); You can also use \\Prince or Kodebyraaet\\Prince\\Facades\\Prince directly anywhere.

Methods
-------

[](#methods)

All methods are chainable so you can dynamically add more and more markup as you go to a Prince document. For example:

```
$prince->html('')
    ->html('Appending more content.
    ->html('');

```

The *html* method takes html as a string and appends it to the internally stored markup.

```
$prince->html('Some HTML');

```

The *view* method takes a Laravel view that has not yet been rendered and renders is and appends it to the internally stored markup.

```
$prince->view(View::make('someview',['somevar' => $somevalue]));

```

The *download* method returns a Response object that can be returned to the client for view in browser/download. For example, in a Controller you can return this for a direct view of a generated PDF.

```
return $prince->html('...')->download();

```

The *store* method required a path and returns the same path if successful.

```
$pdfPath = $prince->html('...')->store(public_path('/pdf/example.pdf'));

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~336 days

Total

5

Last Release

2421d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87f6b8e020b6ba1566cab3e910905f264083cca85f9db26ac3593ce385700e66?d=identicon)[kodebyraaet](/maintainers/kodebyraaet)

---

Top Contributors

[![Jon-Myrstad](https://avatars.githubusercontent.com/u/7058316?v=4)](https://github.com/Jon-Myrstad "Jon-Myrstad (4 commits)")[![speccode](https://avatars.githubusercontent.com/u/1951131?v=4)](https://github.com/speccode "speccode (3 commits)")

---

Tags

laravelutility

### Embed Badge

![Health badge](/badges/kodebyraaet-prince/health.svg)

```
[![Health](https://phpackages.com/badges/kodebyraaet-prince/health.svg)](https://phpackages.com/packages/kodebyraaet-prince)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/pipeline

The Illuminate Pipeline package.

9348.3M268](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10533.5M997](/packages/illuminate-pagination)[illuminate/redis

The Illuminate Redis package.

8314.4M363](/packages/illuminate-redis)[illuminate/process

The Illuminate Process package.

44869.2k98](/packages/illuminate-process)[illuminate/cookie

The Illuminate Cookie package.

224.5M132](/packages/illuminate-cookie)

PHPackages © 2026

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