dol/mpdf-bundle

This bundle integrates mPDF library into your Symfony project.

0.1 2019-01-28 16:45 UTC

This package is auto-updated.

Last update: 2024-03-29 03:32:46 UTC


README

Latest Stable Version Total Downloads License Build Status Scrutinizer Code Quality Code Coverage FOSSA Status

This bundle integrates the mPDF library in your Symfony project.

Versions and compatibilities:

  • Build Status Master.
  • Build Status V 1.0.

Installation

Applications that use Symfony Flex

One step ! Download the Bundle

Open a command console, enter your project directory and execute:

composer require dol/mpdf-bundle

Applications that don't use Symfony Flex

1. Download the Bundle

Open a command console, enter your project directory and execute:

composer require dol/mpdf-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

2. Enable the Bundle

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new DoL\MpdfBundle\DoLMpdfBundle(),
        ];
        
        // ...
    }
    
    // ...
}

Usage

Get a Mpdf instance

<?php
  // Simple instance
  $mpdf = $this->get('dol_mpdf.mpdf_service')->getMpdf();
  
  // With configuration
  $mpdf = $this->get('dol_mpdf.mpdf_service')->getMpdf([
    'mode' => 'utf-8',
    'format' => 'A4',
  ]);

Reporting an issue or a feature request

Issues and feature requests are tracked in the GitHub issue tracker.

When reporting a bug, it may be a good idea to reproduce it in a basic project built using the Symfony Standard Edition to allow developers of the bundle to reproduce the issue by simply cloning it and following some steps.

License

FOSSA Status