PHPackages                             baidouabdellah/laravel-arpdf - 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. baidouabdellah/laravel-arpdf

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

baidouabdellah/laravel-arpdf
============================

Generate Arabic-friendly PDFs in Laravel with a driver-based architecture (mPDF by default)

3.0.0(3mo ago)8529↓60%4MITPHPPHP ^8.0

Since Oct 20Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/baidou5/laravel-arpdf)[ Packagist](https://packagist.org/packages/baidouabdellah/laravel-arpdf)[ RSS](/packages/baidouabdellah-laravel-arpdf/feed)WikiDiscussions main Synced yesterday

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

[![ArPDF Logo](https://raw.githubusercontent.com/baidou5/laravel-arpdf/main/arpdf.jpg)](https://raw.githubusercontent.com/baidou5/laravel-arpdf/main/arpdf.jpg)

Laravel ArPDF
=============

[](#laravel-arpdf)

Arabic-first PDF generation for Laravel, rebuilt from scratch on top of **mPDF**.

`laravel-arpdf` is designed for production-grade Arabic documents (invoices, contracts, reports) with stable RTL rendering, Arabic shaping, and robust font handling.

Why This Is Stronger Than Dompdf
--------------------------------

[](#why-this-is-stronger-than-dompdf)

- Native mPDF engine focused on complex scripts (Arabic/RTL)
- Better Arabic glyph shaping and bidirectional text handling
- Reliable custom font loading and fallback strategy
- Rich PDF controls: metadata, margins, header/footer, watermark

Core Features
-------------

[](#core-features)

- Full Arabic + RTL + UTF-8 support
- Fluent Laravel API
- Custom Arabic fonts via config map
- `stream`, `download`, `save`, and raw `string` output
- Header / footer HTML
- Text or image watermark
- Metadata API (`title`, `author`, `subject`, `keywords`, `creator`)
- Reusable document profiles (`profile('invoice_ar')`)
- Named templates with variable interpolation
- Layouts and reusable components for templates
- Report Builder DSL for business reports
- File queue pipeline for deferred rendering
- Laravel queue pipeline (`dispatch` / `dispatchSync`)
- Plugin API (before/after render hooks)
- Plugin marketplace with named built-ins (`watermark_text`, `signature_block`, `quick_qr`, `certificate_signature`)
- Snapshot testing workflow for PDF regression checks
- PDF render cache for repeated documents

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

[](#installation)

```
composer require baidouabdellah/laravel-arpdf
```

Publish config and fonts (optional but recommended):

```
php artisan vendor:publish --provider="Baidouabdellah\LaravelArpdf\ArPDFServiceProvider"
```

Quick Example
-------------

[](#quick-example)

```
use ArPDF;

public function invoice()
{
    return ArPDF::direction('rtl')
        ->title('فاتورة')
        ->author('My Company')
        ->header('رأس الصفحة')
        ->footer('{PAGENO}')
        ->watermarkText('سري')
        ->loadView('pdf.invoice', ['title' => 'فاتورة'])
        ->download('invoice.pdf');
}
```

Production Features
-------------------

[](#production-features)

```
ArPDF::profile('invoice_ar')
    ->registerTemplate('invoice_basic', '{{ title }}{{ customer.name }}')
    ->loadTemplate('invoice_basic', [
        'title' => 'فاتورة',
        'customer' => ['name' => 'أحمد'],
    ])
    ->useCache(true, 3600)
    ->download('invoice.pdf');
```

Layouts, Components, Reports, Queue
-----------------------------------

[](#layouts-components-reports-queue)

```
$pdf = app(\Baidouabdellah\LaravelArpdf\ArPDF::class);

$pdf->registerLayout('base', '{{ section:header }}{{ content }}{{ component:footer }}')
    ->registerComponent('footer', '{{ company }}')
    ->registerTemplate('invoice', \"@layout('base')\\n@section('header'){{ title }}@endsection\\n{{ customer.name }}\")
    ->loadTemplate('invoice', [
        'title' => 'فاتورة',
        'customer' => ['name' => 'أحمد'],
        'components' => ['footer' => ['company' => 'My Co']],
    ]);

$pdf->report(function ($r) {
    $r->heading('تقرير شهري')->table(['البند', 'القيمة'], [['المبيعات', 15000]]);
});

$pipeline = $pdf->queuePipeline(); // file-based queue
$jobId = $pipeline->enqueue($pdf, storage_path('app/reports/monthly.pdf'));
$pipeline->processNext();

$pdf->laravelQueuePipeline()->dispatchSync($pdf, storage_path('app/reports/sync.pdf'));
```

Plugins &amp; Snapshots
-----------------------

[](#plugins--snapshots)

```
use Baidouabdellah\LaravelArpdf\Contracts\PdfPlugin;

class FooterPlugin implements PdfPlugin {
    public function beforeRender($pdf, string $html, array $options): array {
        return ['html' => $html . 'Signed', 'options' => $options];
    }
    public function afterRender($pdf, string $binary, array $context): string {
        return $binary;
    }
}

$pdf->usePlugin(new FooterPlugin())->loadHTML('Doc');

$pdf->usePluginNamed('watermark_text', ['text' => 'CONFIDENTIAL', 'alpha' => 0.15])
    ->usePluginNamed('signature_block', ['signer' => 'Admin', 'title' => 'CTO'])
    ->usePluginNamed('quick_qr', ['text' => 'INV-1001', 'size' => 90]) // offline QR
    ->loadHTML('Invoice');

$pdf->usePluginNamed('certificate_signature', [
    'private_key' => storage_path('keys/private.pem'),
    'certificate' => storage_path('keys/cert.pem'),
    'sidecar_path' => storage_path('app/signatures/invoice.sig.json'),
]);

$check = \Baidouabdellah\LaravelArpdf\ArPDF::verifySignature(
    storage_path('app/invoices/invoice.pdf'),
    storage_path('app/signatures/invoice.sig.json'),
    storage_path('keys/cert.pem')
);

// Artisan command
// php artisan arpdf:verify-signature storage/app/invoices/invoice.pdf storage/app/signatures/invoice.sig.json --cert=storage/keys/cert.pem

$result = $pdf->assertSnapshot('doc-v1'); // stores/compares sha256 snapshot
if (! $result['matched']) {
    // regression detected
}
```

Output Destinations
-------------------

[](#output-destinations)

`output($filename, $dest)` supports:

- Legacy: `I`, `D`, `F`, `S`
- Named: `inline`, `download`, `file`, `string`

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

[](#configuration)

Main options in `config/arpdf.php`:

- `direction`, `default_font`, `fonts_path`, `fonts`
- `paper`, `orientation`, `margins`
- `metadata`
- `mpdf` (native mPDF overrides)

Testing
-------

[](#testing)

```
vendor/bin/phpunit -c tests/phpunit.xml
```

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance78

Regular maintenance activity

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.8% 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 ~125 days

Total

5

Last Release

119d ago

Major Versions

v1.3.0 → 3.0.02026-03-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/2147eb2fca7ab5f0124d0fafd88ba2d2a5dfa3a0036fb8872d1084b7cba29366?d=identicon)[fadymondy](/maintainers/fadymondy)

![](https://www.gravatar.com/avatar/216f792e1285980ea75f9060eeacae300b6bba5061c0cd45e10b5f49491411ff?d=identicon)[baidou](/maintainers/baidou)

---

Top Contributors

[![baidou5](https://avatars.githubusercontent.com/u/72502903?v=4)](https://github.com/baidou5 "baidou5 (45 commits)")[![fadymondy](https://avatars.githubusercontent.com/u/11937812?v=4)](https://github.com/fadymondy "fadymondy (1 commits)")

---

Tags

arabic-languagelaravel-packagepackagepdf-documentpdf-generation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/baidouabdellah-laravel-arpdf/health.svg)

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

###  Alternatives

[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43311.1k](/packages/venturedrake-laravel-crm)[abydahana/aksara

Aksara is a CodeIgniter based CRUD Toolkit you can use to build complex applications become shorter, secure and more reliable just in a few lines of code. Serving both CMS or Framework, produce both HEADLESS (RESTful API) or TRADITIONAL (Browser Based), just by writing single controller. Yet it's reusable, scalable and ready to use!

1111.2k](/packages/abydahana-aksara)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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