PHPackages                             actualreports/pdfgeneratorapi-laravel - 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. actualreports/pdfgeneratorapi-laravel

AbandonedArchivedLibrary[PDF &amp; Document Generation](/categories/documents)

actualreports/pdfgeneratorapi-laravel
=====================================

PDF Generator API package for Laravel

v1.0.6(7y ago)31.4k3[1 issues](https://github.com/actualreports/pdfgeneratorapi-laravel/issues)MITPHPPHP ~5.6|~7.0

Since Nov 23Pushed 7y ago2 watchersCompare

[ Source](https://github.com/actualreports/pdfgeneratorapi-laravel)[ Packagist](https://packagist.org/packages/actualreports/pdfgeneratorapi-laravel)[ Docs](https://pdfgeneratorapi.com)[ RSS](/packages/actualreports-pdfgeneratorapi-laravel/feed)WikiDiscussions master Synced 2mo ago

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

PDF Generator API for Laravel
=============================

[](#pdf-generator-api-for-laravel)

This Laravel package creates controllers and routes to easily use the [PDF Generator API](https://pdfgeneratorapi.com) service. It also includes javascript interface to print and download generated files, and to open templates in the editor view.

Install
-------

[](#install)

Require this package with composer using the following command:

```
composer require actualreports/pdfgeneratorapi-laravel
```

If you don't use Laravel 5.5 auto-discovery, add the service provider and the alias to config/app.php. If you run Laravel 5.5 this is done automatically.

Add provider

```
ActualReports\PDFGeneratorAPILaravel\ServiceProvider::class,
```

Add alias

```
'PDFGeneratorAPI' => ActualReports\PDFGeneratorAPILaravel\Facade::class,
```

Publishes configuration file to your config folder (config/pdfgeneratorapi.php)

```
php artisan vendor:publish --provider="ActualReports\PDFGeneratorAPILaravel\ServiceProvider" --tag=config
```

Publishes javascript to your assets folder (resources/assets/vendor/pdfgeneratorapi/index.js)

```
php artisan vendor:publish --provider="ActualReports\PDFGeneratorAPILaravel\ServiceProvider" --tag=public --force
```

Configuration
-------------

[](#configuration)

Add configuration to your .env file

```
PDF_GENERATOR_KEY={YOUR_API_KEY}
PDF_GENERATOR_SECRET={YOUR_API_SECRET}
PDF_GENERATOR_BASE_URL=https://us1.pdfgeneratorapi.com/api/v3/
PDF_GENERATOR_USE_DATA_URL=true
```

If "PDF\_GENERATOR\_USE\_DATA\_URL" is set to true then we send an url to your data file instead of sending the data in request body. This feature exists because of the url length limitations. When we redirect user to the editor view with json data in query param then we have are limited to browser url length and the data string can be incomplete.

To make this feature work you need to link your public folder. Data files are saved to /storage/app/public/pdfgenerator

```
php artisan storage:link
```

Usage
-----

[](#usage)

We have included the javascript interface that makes calls to routes defined below and displays the result in browser. If you need more flexibility you can create your own front end interface that use the routes.

### Data Repository

[](#data-repository)

The main controller depends on ActualReports\\PDFGeneratorAPILaravel\\Repositories\\DataRepository to get the data that is sent to PDF Generator service. By default the data repository looks for the "data" parameter in request using Input::get('data').

You can add your own DataRepository by implementing interface ActualReports\\PDFGeneratorAPILaravel\\Contracts\\DataRepository and overriding the binding in your AppServiceProvider.php register() function.

```
$this->app->bind(
    'ActualReports\PDFGeneratorAPILaravel\Contracts\DataRepository',
    'App\Repositories\DataRepository'
);
```

### User Repository

[](#user-repository)

The main controller depends on `ActualReports\PDFGeneratorAPILaravel\Repositories\UserRepository` to generate unique workspace identifier for logged in user.

You can add your own UserRepository by implementing interface `ActualReports\PDFGeneratorAPILaravel\Contracts\UserRepository` and overriding the binding in your AppServiceProvider.php register() function.

```
$this->app->bind(
    'ActualReports\PDFGeneratorAPILaravel\Contracts\DataRepository',
    'App\Repositories\DataRepository'
);
```

### Routes

[](#routes)

Available routes

- pdfgenerator.templates.all: GET /pdfgenerator/templates
- pdfgenerator.templates.get: GET /pdfgenerator/templates/{template}
- pdfgenerator.templates.output: GET|POST /pdfgenerator/templates/{template}/{output}/{format}
- pdfgenerator.templates.new: GET|POST /pdfgenerator/templates/new
- pdfgenerator.templates.edit: GET|POST /pdfgenerator/templates/{template}/edit
- pdfgenerator.templates.copy: GET|POST /pdfgenerator/templates/{template}/copy

### JavaScript interface

[](#javascript-interface)

Init javascript interface

```
PDFGeneratorAPI.init();
```

Fetches list of available templates

```
PDFGeneratorAPI.list().then((response) => {
  console.log(response);
});
```

Executes print command that generates the document and opens browser print dialog

```
PDFGeneratorAPI.print(template, format, data).then(() => {
  console.log('resolve print promise');
});
```

Executes download command that generates the document and starts download automatically

```
PDFGeneratorAPI.download(template, format, data).then(() => {
  console.log('resolve download promise');
});
```

Executes inline command that generates the document and opens it in new tab/window

```
PDFGeneratorAPI.inline(template, format, data).then(() => {
  console.log('resolve inline promise');
});
```

Opens new tab/window with template editor

```
PDFGeneratorAPI.edit(template, data).then(() => {
  console.log('resolves when editor tab/window is closed');
});
```

Creates a copy of a given template and opens new tab/window with template editor

```
PDFGeneratorAPI.copy(template, data, 'New name for copied template').then(() => {
  console.log('resolves when editor tab/window is closed');
});
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~76 days

Recently: every ~133 days

Total

8

Last Release

2555d ago

Major Versions

v0.1 → v1.0.12017-11-23

### Community

Maintainers

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

---

Top Contributors

[![tanelt](https://avatars.githubusercontent.com/u/925861?v=4)](https://github.com/tanelt "tanelt (10 commits)")[![actualreports](https://avatars.githubusercontent.com/u/3816888?v=4)](https://github.com/actualreports "actualreports (9 commits)")[![estcode](https://avatars.githubusercontent.com/u/13463206?v=4)](https://github.com/estcode "estcode (1 commits)")

---

Tags

laravellaravel-pdfpdf-generationpdf-generatorpdf-generator-apiphppdflaravel-pdf-generator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/actualreports-pdfgeneratorapi-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/actualreports-pdfgeneratorapi-laravel/health.svg)](https://phpackages.com/packages/actualreports-pdfgeneratorapi-laravel)
```

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[consoletvs/invoices

Generate PDF invoices for your customers in laravel

455275.5k](/packages/consoletvs-invoices)[webklex/laravel-pdfmerger

Generic PDF merger for Laravel

1422.6M2](/packages/webklex-laravel-pdfmerger)[jimmyjs/laravel-report-generator

Rapidly Generate Simple Pdf &amp; Excel Report on Laravel 5 (Using Barryvdh/DomPdf or Barryvdh/laravel-snappy &amp; maatwebsite/excel)

580157.4k1](/packages/jimmyjs-laravel-report-generator)

PHPackages © 2026

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