PHPackages                             arabic-pdf-export/arabic-pdf-export - 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. arabic-pdf-export/arabic-pdf-export

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

arabic-pdf-export/arabic-pdf-export
===================================

A Laravel package for generating PDFs with proper Arabic text support

1.1.0(7mo ago)174MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3

Since Sep 20Pushed 7mo agoCompare

[ Source](https://github.com/hsnww/arabic-pdf-export)[ Packagist](https://packagist.org/packages/arabic-pdf-export/arabic-pdf-export)[ Docs](https://github.com/hsnww/arabic-pdf-export)[ RSS](/packages/arabic-pdf-export-arabic-pdf-export/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Arabic PDF Export Package
=========================

[](#arabic-pdf-export-package)

A comprehensive Laravel package for generating PDFs with proper Arabic text support, including RTL (Right-to-Left) text direction and Arabic font rendering.

Features
--------

[](#features)

- **Full Arabic Text Support**: Proper RTL text direction and Arabic font rendering
- **Multiple PDF Engines**: Support for both TCPDF and DomPDF engines
- **Arabic Fonts Included**: Amiri and Cairo font families with multiple weights
- **Quran Text Support**: Special formatting for Quranic text
- **Laravel Integration**: Easy integration with Laravel applications
- **Blade Directives**: Custom Blade directives for PDF generation
- **Flexible Configuration**: Extensive configuration options
- **Console Commands**: Artisan commands for font installation

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

[](#installation)

1. Install the package via Composer:

```
composer require arabic-pdf-export/arabic-pdf-export
```

2. Publish the configuration file:

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

3. Install Arabic fonts to public directory:

```
php artisan arabic-pdf:install-fonts
```

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

[](#configuration)

The package configuration is located in `config/arabic-pdf.php`. You can customize:

- PDF engine (TCPDF or DomPDF)
- Page format and orientation
- Margins
- Font settings
- Default CSS classes

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use ArabicPdfExport\Facades\ArabicPdf;

// Generate a simple Arabic document
$html = 'عنوان المستند
         هذا نص باللغة العربية';

$pdf = ArabicPdf::generate($html);

// Download the PDF
ArabicPdf::download($html, 'document.pdf');

// Save to file
ArabicPdf::save($html, storage_path('app/document.pdf'));
```

### Using Service Container

[](#using-service-container)

```
use ArabicPdfExport\ArabicPdfService;

$arabicPdf = app('arabic-pdf');

$html = 'مرحباً بالعالم';
$pdf = $arabicPdf->generate($html);
```

### Blade Directives

[](#blade-directives)

```
{{-- Generate PDF content --}}
@arabicPdf('عنوانمحتوى')

{{-- Download PDF --}}
@arabicPdfDownload('محتوى للتحميل', 'document.pdf')

{{-- Save PDF --}}
@arabicPdfSave('محتوى للحفظ', storage_path('app/saved.pdf'))
```

### Creating Documents

[](#creating-documents)

#### Simple Document

[](#simple-document)

```
$pdf = ArabicPdf::createSimpleDocument(
    'عنوان المستند',
    'هذا محتوى المستند باللغة العربية',
    ['title' => 'My Document']
);
```

#### Quran Document

[](#quran-document)

```
$pdf = ArabicPdf::createQuranDocument(
    'البقرة',
    '255',
    'اللَّهُ لَا إِلَٰهَ إِلَّا هُوَ الْحَيُّ الْقَيُّومُ',
    ['title' => 'آية الكرسي']
);
```

### Custom HTML with CSS Classes

[](#custom-html-with-css-classes)

```
$html = '
عنوان رئيسي
عنوان فرعي
هذه فقرة عربية مع محاذاة صحيحة للنص.
نص قرآني بخط خاص
نص عادي باللغة العربية
';

$pdf = ArabicPdf::generate($html);
```

### Configuration Options

[](#configuration-options)

```
// Set custom configuration
ArabicPdf::setConfig([
    'engine' => 'tcpdf',
    'page_format' => 'A4',
    'orientation' => 'P',
    'margin_top' => 20,
    'default_font' => 'Cairo-Regular'
]);

// Get current configuration
$config = ArabicPdf::getConfig();

// Set default font
ArabicPdf::setDefaultFont('Amiri-Bold');

// Get available fonts
$fonts = ArabicPdf::getAvailableFonts();
```

Available Fonts
---------------

[](#available-fonts)

The package includes the following Arabic fonts:

- **Amiri Family**:

    - Amiri-Regular
    - Amiri-Bold
    - Amiri-Italic
    - Amiri-BoldItalic
    - AmiriQuran (for Quranic text)
    - AmiriQuranColored (colored Quranic text)
- **Cairo Family**:

    - Cairo-Regular
    - Cairo-Bold

CSS Classes
-----------

[](#css-classes)

The package provides predefined CSS classes for Arabic text:

- `.arabic-title`: For main titles
- `.arabic-subtitle`: For subtitles
- `.arabic-paragraph`: For regular paragraphs
- `.arabic-text`: For general Arabic text
- `.quran-text`: For Quranic text

Advanced Usage
--------------

[](#advanced-usage)

### Custom PDF Engine

[](#custom-pdf-engine)

```
// Use TCPDF engine
$pdf = ArabicPdf::generateWithTcpdf($html);

// Use DomPDF engine
$pdf = ArabicPdf::generateWithDompdf($html);
```

### Custom Configuration

[](#custom-configuration)

```
$arabicPdf = new ArabicPdfService([
    'engine' => 'tcpdf',
    'page_format' => 'A4',
    'orientation' => 'L', // Landscape
    'margin_top' => 25,
    'margin_right' => 20,
    'margin_bottom' => 25,
    'margin_left' => 20,
    'default_font' => 'Cairo-Bold'
]);
```

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- Laravel 9.0 or higher
- TCPDF 6.4 or higher
- DomPDF 2.0 or higher

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Support
-------

[](#support)

For support, please open an issue on the GitHub repository.

Changelog
---------

[](#changelog)

### Version 1.0.0

[](#version-100)

- Initial release
- Arabic text support with RTL direction
- Multiple PDF engines (TCPDF, DomPDF)
- Arabic fonts included
- Laravel integration
- Blade directives
- Console commands

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance66

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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 ~0 days

Total

4

Last Release

230d ago

PHP version history (2 changes)1.0.0PHP ^8.0

1.0.2PHP ^7.4|^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

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

---

Top Contributors

[![hsnww](https://avatars.githubusercontent.com/u/63775486?v=4)](https://github.com/hsnww "hsnww (12 commits)")

---

Tags

laravelpdfTCPDFdompdfarabicrtl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arabic-pdf-export-arabic-pdf-export/health.svg)

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M274](/packages/barryvdh-laravel-dompdf)[elibyy/tcpdf-laravel

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

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

A simple Laravel 4 service provider with some basic configuration for including the TCPDF library

8725.7k](/packages/maxxscho-laravel-tcpdf)[tarfin-labs/easy-pdf

Makes pdf processing easy.

1718.3k](/packages/tarfin-labs-easy-pdf)

PHPackages © 2026

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