PHP library generating PDF files from UTF-8 encoded HTML

Related tags

PDF css html php pdf utf-8 cjk
Overview

mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML.

It is based on FPDF and HTML2FPDF (see CREDITS), with a number of enhancements. mPDF was written by Ian Back and is released under the GNU GPL v2 licence.

Latest Stable Version Total Downloads License

If you are viewing this file on mPDF GitHub repository homepage or on Packagist, please note that the default repository branch is development which can differ from the last stable release.

Requirements

PHP versions and extensions

  • mPDF >=7.0 is supported on PHP ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0
  • PHP 7.3 is supported since mPDF v7.1.7
  • PHP 7.4 is supported since mPDF v8.0.4
  • PHP 8.0 is supported since mPDF v8.0.10

PHP mbstring and gd extensions have to be loaded.

Additional extensions may be required for some advanced features such as zlib for compression of output and embedded resources such as fonts, bcmath for generating barcodes or xml for character set conversion and SVG handling.

Known server caveats

mPDF has some problems with fetching external HTTP resources with single threaded servers such as php -S. A proper server such as nginx (php-fpm) or Apache is recommended.

Support us

Consider supporting development of mPDF with a donation of any value. Donation button can be found on the main page of the documentation.

Installation

Official installation method is via composer and its packagist package mpdf/mpdf.

$ composer require mpdf/mpdf

Usage

The simplest usage (since version 7.0) of the library would be as follows:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('<h1>Hello world!</h1>');
$mpdf->Output();

This will output the PDF inline to the browser as application/pdf Content-type.

Setup & Configuration

All configuration directives can be set by the $config parameter of the constructor.

It is recommended to set one's own temporary directory via tempDir configuration variable. The directory must have write permissions (mode 775 is recommended) for users using mPDF (typically cli, webserver, fpm).

Warning: mPDF will clean up old temporary files in the temporary directory. Choose a path dedicated to mPDF only.

<?php

$mpdf = new \Mpdf\Mpdf(['tempDir' => __DIR__ . '/tmp']);

By default, the temporary directory will be inside vendor directory and will have write permissions from post_install composer script.

For more information about custom temporary directory see the note on Folder for temporary files in the section on Installation & Setup in the manual.

If you have problems, please read the section on troubleshooting in the manual.

Online manual

Online manual is available at https://mpdf.github.io/.

For general questions or troubleshooting please use the mpdf tag at Stack Overflow (and not the project's issue tracker).

Contributing

Before submitting issues and pull requests please read the CONTRIBUTING.md file.

Unit Testing

Unit testing for mPDF is done using PHPUnit.

To get started, run composer install from the command line while in the mPDF root directory (you'll need composer installed first).

To execute tests, run composer test from the command line while in the mPDF root directory.

Any assistance writing unit tests for mPDF is greatly appreciated. If you'd like to help, please note that any PHP file located in the /tests/ directory will be autoloaded when unit testing.

Comments
  • PHP 8 support

    PHP 8 support

    At the moment, use dev-php8-support constraint in composer to use mpdf version with PHP8 support.


    Currently, mPDF works OK woth 8.0-alpha2 as-is, but testing is an issue as older Mockery version used for mocking in tests is no longer compatible (Reflection issues).

    Unless tests are fixed, support will not be official. There are a few possible approaches to address this:

    • Remove PHP 5.6 support and upgrade underlying libraries (not sure if sufficient with PHP 7.0 support)
    • Replace Mockery with another usable mocking framework (unlikely)
    • Fork Mockery and quickfix issues with Reflection (management issues)
    • Rewrite parts of mPDF (especially internal support classes dependencies on mPDF) to remove the need for mocking in tests; related #58 and #1262 (this would also solve other issues such as #1227)
    feature/enhancement 
    opened by finwe 60
  • Entire mPDF Manual Offline...

    Entire mPDF Manual Offline...

    Looks like Ian has shut down the mPDF website: http://www.mpdf1.com/mpdf/index.php

    It also appears the entire mPDF online documentation is now offline. What's the game plan? We need to have reliable online documentation. I see there's a full PDF version of the docs which will have to do for the moment, but it's not ideal.

    opened by jakejackson1 37
  • License issue: GPL v2 vs. ASL 2.0

    License issue: GPL v2 vs. ASL 2.0

    It's not really clear under which GPL version mPDF is released. On this page it seems like it is release under both. In the LICENSE.txt version 2 is declared. Somewhere in the source code only "GPL" without a version is used. So I guess it's version 2 atm.

    Anyhow, mPDF includes code which is released under the "Apache Software License 2.0" (classes from FPDI) which is incompatible to GPL v2 while it is compatible to GPL v3.

    This issue exists for several years now, but as I just updated the classes from FPDI (#16) I though it's time to move at least to GPL v3?

    question 
    opened by JanSlabon 33
  • refactor: split src/Tag.php into classes

    refactor: split src/Tag.php into classes

    As proposed in #551, this is an attempt to refactor src/Tag.php

    I took care of carefully migrating the code, tag by tag and separated my commits.

    I avoided changes to the maximum to keep this PR focused. It's basically the switch/case re-implemented in OOP by taking in accounts cases where there were no breaks, etc.

    Unit testing seems okay, but I'm wondering if there is a better way to validate that I didn't break things. Is there a reference PDF file with all what mPDF can produce somewhere, along with the script to generate it?

    opened by machour 24
  • Undesired mouseover effect on links in PDF

    Undesired mouseover effect on links in PDF

    Latest version of Chrome (Version 55.0.2883.95 (64-bit)) Mac OSX 10.10.5 MPDF 5.7.3

    With a Chrome upgrade am now seeing an ugly yellow box appear on mouseover of all links in generated PDFs. The PDFs are fine in other browsers and native viewers, but not so hot in Chrome

    I've attached a screenshot of the behaviour. It happens in new PDFs as well as ones created previously, so is Chrome related. Any thoughts on what could be causing it?

    pdfwot

    question wontfix/worksforme 
    opened by travelfish 22
  • Extra page in table of contents. (<tocpagebreak>)

    Extra page in table of contents. ()

    I have this problem/would like to have this functionality

    The table of contents has 2 pages by default. In a short document, this is not necessary. Is there a way to suppress this second page?

    mPDF version 6.0

    This is a HTML code snippet I use

    <body>
    <tocpagebreak></tocpagebreak>
    <page>
    <tocentry content="toc name" level="0"></tocentry>
    toc name
    </page>
    </body>
    
    opened by tomacadi 21
  • WIP: add support for orphan and widow page breaking

    WIP: add support for orphan and widow page breaking

    To config min lines require before allowing a block orphan / widow update config.php:

    $this->minWidowLines = 3; $this->minOrphanLines = 3;

    a value of 0 here should result in current behavior without auto breaks.

    I have only so far tested with examples/example02_CSS_styles.php, and this is a bit of a hasty patch, so any help with testing, examples, and feedback (be critical, I can take it ;-) would be very much appreciated. I would be interested in the proper way to regression test and make sure I didn't break anything with these changes as well.

    feature/enhancement 
    opened by thnkloud9 21
  • unreadable text in the table small mPDF

    unreadable text in the table small mPDF

    Error converting html to pdf tables, it turns out too small. The text is impossible to read, I have already tried the following methods to solve the problem:

    1. $ mpdf-> shrink_tables_to_fit = 0
    2. $ mpdf-> shrink_tables_to_fit = 1
    3. table autosize = "1"
    4. table autosize = "0"

    also applied styles to the table,

    1. page-break-inside: avoid

    All this did not help me solve the problem.

    A possible solution in this thread, but I did not understand how to apply it - https://github.com/mpdf/mpdf/issues/650


    header ('Content-Type: application / pdf'); require_once '/autoload.php'; $ mpdf = new \ Mpdf \ Mpdf ([ 'mode' => 'utf-8',

    'margin_left' => 5, 'margin_right' => 5, 'margin_top' => 5, 'margin_bottom' => 5,

    ]); $ mpdf-> SetTitle ('PDF'); $ stylesheet = file_get_contents ("/ stylempdf.css"); $ html = file_get_contents ("/ $ id_zapros.html");

    $ mpdf-> autoPageBreak = false;

    $ mpdf-> WriteHTML ($ stylesheet, \ Mpdf \ HTMLParserMode :: HEADER_CSS); $ mpdf-> WriteHTML ($ html, \ Mpdf \ HTMLParserMode :: DEFAULT_MODE);

    $ pdfFilePath = "123.pdf"; $ mpdf-> Output ($ pdfFilePath, "D");


    my html - https://cloud.mail.ru/public/LhSp/wjPgqRVQb my rezult Pdf - https://cloud.mail.ru/public/4Pri/tniujD5gN

    I need your help, thanks in advance

    opened by feniksbot 19
  • PHP Parse Error (mpdf 7.0.4)

    PHP Parse Error (mpdf 7.0.4)

    I found this bug

    PHP Parse Error – yii\base\ErrorException parse error, expecting ','' or';'' in /vendor/mpdf/mpdf/src/Mpdf.php at line 60 const SCALE = 72 / 25.4;

    This is mPDF and PHP version and environment (fpm/cli etc) I am using

    mpdf 7.0.4 php 5.6

    wontfix/worksforme 
    opened by yaroslavolekh 19
  • [PHP 7.1] Another numeric value error

    [PHP 7.1] Another numeric value error

    I have this problem/would like to have this functionality

    With our PDF files, we get this error.

    Warning: A non-numeric value encountered in /Users/xxx/PhpstormProjects/xxx/vendor/mpdf/mpdf/mpdf.php on line 25843

    Warning: A non-numeric value encountered in /Users/xxx/PhpstormProjects/xxx/vendor/mpdf/mpdf/mpdf.php on line 25848

    These are mPDF and PHP versions I am using

    7.0.0-beta2 dev-master (f3bbfc7133aed4b7bbdc22b243883bf552558211)

    This is a PHP code snippet I use

    <?php
    
    require __DIR__.'/../vendor/autoload.php';
    
    $pdfDir = '/Users/xxx/Downloads/pdfs';
    
    $pdfFilePaths = glob(sprintf('%s/*.pdf', $pdfDir));
    
    $mpdf = new  \Mpdf\Mpdf();
    $mpdf->debug = true;
    $mpdf->SetImportUse();
    
    foreach ($pdfFilePaths as $pdfFilePath) {
        $pagecount = $mpdf->SetSourceFile($pdfFilePath);
    
        for($i=0; $i < $pagecount; $i++){
            $mpdf->AddPage();
            $template = $mpdf->importPage($i+1, $pdfFilePath);
            $mpdf->useTemplate($template);
        }
    }
    
    $mpdf->Output();
    

    This is a HTML code snippet I use

    no HTML files

    We open existing PDF-files with 1 or several pages and merge them together to one pdf file.

    Solution

    I will create a pull request later with unit-tests.

    opened by sebastianblum 19
  • "Checked" on checkbox does not work correctly

    I am trying to create a fillable PDF (PDF form), but checkbox does not work correctly. Could you please help me to make it works?

    The problem is that the attribute of "checked" does not work. I found that it must be checked="checked", but the result is not changed.

    PHP: ver 7.4.4 mPDF: ver 8.0.4

    <?php
    $html = '
    <body>
    	<label for="s44_1"><input type="checkbox" name="s44_1" id="s44_1" value="1" /> 1</label><br />
    	<label for="s44_2"><input type="checkbox" name="s44_2" id="s44_2" value="2" /> 2</label><br />
    	<label for="s44_3"><input type="checkbox" name="s44_3" id="s44_3" value="3" checked="checked" /> 3</label><br />
    	<label for="s44_4"><input type="checkbox" name="s44_4" id="s44_4" value="4" /> 4</label><br />
    	<label for="s44_5"><input type="checkbox" name="s44_5" id="s44_5" value="5" /> 5</label>
    </body>
    </html>
    ';
    
    //==============================================================
    require_once __DIR__ . '/vendor/autoload.php';
    
    $mpdf = new \Mpdf\Mpdf();
    $mpdf->useActiveForms = true;
    $mpdf->SetTitle("Sample_Fillable");
    
    // OUTPUT
    $mpdf->WriteHTML($html);
    $mpdf->Output('Sample_Fillable.pdf', 'D');
    
    exit;
    ?>
    
    wontfix/worksforme 
    opened by Kota-M 18
  • Update default user agent used for cURL requests

    Update default user agent used for cURL requests

    Recently I started getting reports about HTTP(S) images not being loaded in PDFs from SiteGround hosted websites. The investigation into this revealed that SiteGround's anti-bot system is now blocking requests with old user agents because they are considered suspicious.

    Information from SiteGround:

    "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1" As you can see, it is using a quite old Firefox version (released in June 5, 2012) which is considered as suspicious and blocked by our anti-bot system. We recently started blocking such requests which originate from User Agents with quite old browser versions as in most cases these are malicious.

    The recommended solution is to update the user agent to the current version of Firefox.

    I haven't added any unit tests for this change because it would require an external HTTP request to a SiteGround hosted website to replicate, which is slow, flaky, and a potential privacy issue. Since the issue only happens on an external request, I don't believe an appropriate unit test can be written for this specific update (let me know if you've any ideas, and I'll be happy to add it).

    opened by jakejackson1 0
  • mPDF crashes on mkdir for its cache directory

    mPDF crashes on mkdir for its cache directory

    Guidelines

    Description of the bug

    I use Mpdf via composer ("mpdf/mpdf": "~8.1") and I regularly have an error related to the creation (sometimes the deletion) of a Cache directory because having many PDF files to create, the processor launches several concurrent processes. It seems that the Cache directory being unique for all processes, it regularly happens that the directory has just been created by a process A and that another process also tries to create it. What solution can we find to avoid this problem? Shouldn't the cache directory be private to each process, for example by giving a name based on a random string?

    Here is the stack of the error received:

    ERROR: ErrorException: mkdir(): File exists in /var/app/current/vendor/mpdf/mpdf/src/Cache.php:49 Stack trace: #0 [internal function]: log_error(2, 'mkdir(): File e...', '/var/app/curren...', 49) #1 /var/app/current/vendor/mpdf/mpdf/src/Cache.php(49): mkdir('/var/app/curren...') #2 /var/app/current/vendor/mpdf/mpdf/src/Cache.php(35): Mpdf\Cache->createDirectory('/var/app/curren...') #3 /var/app/current/vendor/mpdf/mpdf/src/Cache.php(20): Mpdf\Cache->createBasePath('/var/app/curren...') #4 /var/app/current/vendor/mpdf/mpdf/src/ServiceFactory.php(67): Mpdf\Cache->__construct('/var/app/curren...', 3600) #5 /var/app/current/vendor/mpdf/mpdf/src/Mpdf.php(1083): Mpdf\ServiceFactory->getServices(Object(Mpdf\Mpdf), Object(Psr\Log\NullLogger), Array, Object(Mpdf\Language\LanguageToFont), Object(Mpdf\Language\ScriptToLanguage), NULL, NULL, NULL, NULL) #6 /var/app/current/src/docs/pdfRelevePP.php(109): Mpdf\Mpdf->__construct(Array) #7 /var/app/current/src/index.php(361): makePdfRelevePP(Array) #8 {main}

    mPDF version

    8.1

    PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

    PHP 8.0 running on 64bit Amazon Linux 2/3.5.1

    Reproducible PHP+CSS+HTML snippet suffering by the error

    $mpdf = new \Mpdf\Mpdf( [ 
            'debug' => true,
            'allow_output_buffering' => true ] );  // <-- ERROR
    $mpdf->allow_charset_conversion = true;
    $mpdf->charset_in = 'utf-8';
    $mpdf->setFooter( '{PAGENO} de {nbpg}' );
    $mpdf->WriteHTML( $html );
    $pdf_gen = $mpdf->Output( '', \Mpdf\Output\Destination::STRING_RETURN );
    
    opened by adlcadn 0
  • Local File Read and SSRF vulnerability via img tags

    Local File Read and SSRF vulnerability via img tags

    Guidelines

    Description of the bug

    There is a bug in the fetching of images which allows rendering local files into the PDF document. To exploit this issue an attacker needs to control the src attribute of an img tag.

    mPDF version

    8.1.2, 8.0.17

    PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

    PHP 8.1, Ubuntu server

    Reproducible PHP+CSS+HTML snippet suffering by the error

    For further details, please reach out to [email protected].

    opened by jmoritzc53 1
  • Barcode tag with JSON object

    Barcode tag with JSON object

    Guidelines

    Description of the bug

    Not possible to send Json as code parameter in mPdf tag <barcode> E.g. {"t":1,"d":5} This text is skipped after first quotation mark and QR code displays only {

    mPDF version

    v8.1.2

    PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

    PHP 8.0, Windows Server

    Reproducible PHP+CSS+HTML snippet suffering by the error

    <barcode code="{"t":1,"d":5}" type="qr"/> <barcode code='{"t":1,"d":5}' type="qr"/> neither works

    bug/fix help wanted 
    opened by hejplis12 0
  • Memory Exhausted Error when Sizable Number of CSS Classes Added to a HTML Tag

    Memory Exhausted Error when Sizable Number of CSS Classes Added to a HTML Tag

    Guidelines

    Description of the bug

    If a tag has around 20+ unique classes added to it, the \Mpdf\Utils\Arrays::allUniqueSortedCombinations() and subsequent \Mpdf\Utils\Arrays::combinations() method can cause a fatal PHP error due to exhausted memory (the exact number will depend on the available PHP memory configured; these tests were run with 512MB available).

    When three unique classes are used on a tag, the output from the above methods are:

    Array
    (
        [0] => A
        [1] => B
        [2] => C
        [3] => A.B
        [4] => A.C
        [5] => B.C
        [6] => A.B.C
    )
    

    At four classes you get this output:

    Array
    (
        [0] => A
        [1] => B
        [2] => C
        [3] => D
        [4] => A.B
        [5] => A.C
        [6] => A.D
        [7] => B.C
        [8] => B.D
        [9] => C.D
        [10] => A.B.C
        [11] => A.B.D
        [12] => A.C.D
        [13] => B.C.D
        [14] => A.B.C.D
    )
    

    At 6 classes the array will have 63 key/value pairs, at 12 classes there's 4095 array items, and by the time you're getting to 19 classes you're producing an array with 524287 items.

    It looks like mPDF will loop over the returned array and use the class combinations to check if their is a matching combination assigned to the CSS array. That process appears to be an integral part of the software's cascading CSS support so I don't have a suggestion or workaround to fix this right now.

    mPDF version

    development branch: d70b16738a7524778058853b1c887155b7c4b59c

    PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

    7.4.30

    Reproducible PHP+CSS+HTML snippet suffering by the error

    <?php
    
    use Mpdf\Output\Destination;
    
    require_once __DIR__ . '/vendor/autoload.php';
    
    $mpdf = new \Mpdf\Mpdf();
    $mpdf->WriteHTML('
    <div class="a b c d e f g h i j k l m n o p q r s t u v w x y z">
    
    </div>
    ');
    
    $mpdf->Output(Destination::INLINE);
    
    opened by jakejackson1 0
Releases(v8.1.0)
  • v8.1.0(Apr 16, 2022)

    Version 8.1.0 contains cleanups, fixes, a few code refactorings most importantly leading to a new experimental feature of internal services container.

    Note: as this is an experimental feature, key names and interface names for container services can and will change in future versions.

    Container

    A new optional parameter has been added to the Mpdf class constructor. It expects an instance of \Mpdf\Container\ContainerInterface (which is compatible and in mPDF 10.0 will be replaced by proper PSR-11 ContainerInterface), which can now override two internal services: HTTP client, and local filesystem resource loader.

    HTTP Client

    The Mpdf\Http\ClientInterface, also compatible with and planned to be upgraded to PSR-7 HTTP Client, can be used by the httpClient key of the passed Container and used to restrict remote HTTP calls, implementing HTTP requests cache, altering incoming responses etc. With a simple bridge, it can be used to leverage already used HTTP client in an existing application, such as Guzzle or Symfony HTTP Client.

    By default, a simple implementation based on curl (if available) or sockets (as a fallback) is used.

    Local filesystem content loader

    The simple Mpdf\File\LocalContentLoaderInterface is used to load local content. Custom implementation by the container key localContentLoader can implement restrictions for certain directories of the filesystem to prevent outside HTML code loading unwanted files. Default implementation uses a simple file_get_contents call.

    Unwanted stream wrappers are handled for all local and remote content fetches in an encapsulating internal service.

    Support our work

    Thank you for any work you put into mPDF - refactorings, bug fixes, new feature requests.

    We also welcome any donation.

    Yaaay! 22 million (!) downloads 🎉!

    Hope number of downloads will keep rising!

    Source code(tar.gz)
    Source code(zip)
  • v8.0.0(Mar 15, 2019)

    Version 8.0.0 contains code cleanups, a few minor fixes and features, and most importantly bump of internal dependency of the FPDI library to version 2.

    This introduces a few breaking changes.

    Method SetImportUse has been removed and ImportPage changed case to importPage and has a new signature:

    public function importPage($pageNumber, $box = PageBoundaries::CROP_BOX, $groupXObject = true)
    

    Library generating QR codes has been split to a separate package mpdf/qrcode. This reduced package size by about 6 MB. The library will raise an exception hinting to install the package with composer when needed and not present.


    Complete changeset can be found in changelog and commit history.

    Upgrading from 7.x

    • If you use importing capabilities:
      • remove SetImportUse method calls
      • change ImportPage calls to the new signature
    • If you use QR codes
      • require mpdf/qrcode with composer and you're set

    Support our work

    Thank you for any work you put into mPDF - refactorings, bug fixes, new feature requests.

    We also welcome any donation.

    Yaaay! 5 200 000 downloads 🎉!

    Hope number of downloads will keep rising!

    Source code(tar.gz)
    Source code(zip)
  • v7.1.0(May 18, 2018)

    Version 7.1.0 contains large internal code cleanups, big refactoring of HTML tags handling (big kudos to @machour), fixes of many reported PHP notices, and other fixes (!important breaking size conversion, logger changes in internal services).

    As for new features, orientation constructor $config array can be used to specify page orientation (thanks, @Dasc3er). Headers and footers can be now positioned absolutely (thanks, @jakejackson1). QRCode can have a custom color (@achretien).

    Minor version bump justifies an added dependency of myclabs/deep-copy package needed for the fix of TOC pagination.

    Complete changeset can be found in commit history.

    Support our work

    Thank you for any work you put into mPDF - refactorings, bug fixes, new feature requests.

    We also welcome any donation.

    Yaaay! 3 000 000 downloads 🎉!

    It seems almost unbelievable to get a million downloads since the version 7.0, in a half a year. Thanks for using mPDF!

    Source code(tar.gz)
    Source code(zip)
  • v7.0.0(Oct 19, 2017)

    Version 7.0 is a large code cleanup release with introduction of namespaces, code structure cleanup, introduction of PSR compliant file structure and autoloading. It requires at least PHP 5.6 and is tested with up to PHP 7.2.

    See CHANGELOG for the complete list of changes, fixes and enhancements and README for the quick tour.

    See a documentation chapter on upgrading.

    Breaking changes & Removals

    Composer is now the only officially supported installation method. There are no pre-packaged library archives.

    All classes moved under Mpdf namespace. Main class renamed to Mpdf. Now accepts single $config array parameter in its constructor.

    Most side-effects of the former mpdf.php file were removed.

    Progressbar and graph features were removed.

    All global constants were removed in favor of class constants or configuration directives.

    All errors are now thrown as exceptions extending \Mpdf\MpdfException.

    Enhancements

    Support for up to PHP 7.2. File & directory structure cleanup, PSR-4 autoloading. Refactoring of many easy-to-separate code portions.

    Support for multiple font directories. PDF/A-3 associated files + additional xmp rdf support.

    Introduced PSR-3 logging.

    Library name

    There can be a bit of confusion about the library name casing with introduction of PSR-compliant class naming.

    The name of the library is still mPDF.

    Main namespace is Mpdf, FQN of the main class is \Mpdf\Mpdf, packagist package is mpdf/mpdf.

    Support our work

    We welcome any donation.

    Yaaay! 2 000 000 downloads 🎉!

    The mpdf/mpdf Packagist package surpassed the 2 milion downloads some time around October 14th. Thanks for showing us the appreciation this way.

    Future development

    The v7.0 is far from perfect. It retained many of 6.x branch flaws, incomplete CSS support, far-from-perfect architecture.

    The main goal of this version was to start giving the code a clean and defined structure and slowly starting decomposing it to smaller parts. This helped add support for newer PHP versions.

    There are many things to be done, some of them are laid out in the Issues tracker here on GitHub.

    mPDF now should follow semver. All reported notice and warning fixes will be continually solved in patch releases, smaller new functionality can be added in minor releases. Breaking changes will have to wait for major releases, in this case v8.

    Thanks

    Many thanks to all small contributors to the library mentioned in the changelog, sorry to anyone who was missed.

    Special thanks to @Klap-in for his extensive work on the documentation.

    Source code(tar.gz)
    Source code(zip)
  • v6.1.0(Apr 26, 2016)

    See CHANGELOG.txt for list of changes, fixes and enhancements.

    Composer package mpdf/mpdf is a recommended installation method:

    $ composer require mpdf/mpdf 6.1.0
    

    You can also choose from a variety of pre-packaged files which contain pregenerated autoload library from Composer, so you would then require autoload.php file:

    <?php
    
    require PATH_TO_MPDF . '/vendor/autoload.php';
    
    Source code(tar.gz)
    Source code(zip)
    01-mPDF-v6.1.0.zip(51.43 MB)
    02-mPDF-v6.1.0-without-examples.zip(47.68 MB)
    03-mPDF-v6.1.0-without-examples-and-fonts.zip(4.93 MB)
    04-mPDF-v6.1.0-examples.zip(3.74 MB)
    05-mPDF-fonts.zip(42.75 MB)
Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2

Magento 2 Invoice PDF Generator - helps you to customize the pdf templates for Magento 2. If you have an enabled template and a default template for the store you need your template the system will print the pdf template.

EAdesign 64 Oct 18, 2021
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Snappy Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. It uses the excellent webkit-based wkhtmltopd

KNP Labs 4.1k Dec 30, 2022
PHP library allowing PDF generation or snapshot from an URL or an HTML page. Wrapper for Kozea/WeasyPrint

PhpWeasyPrint PhpWeasyPrint is a PHP library allowing PDF generation from an URL or an HTML page. It's a wrapper for WeasyPrint, a smart solution help

Pontedilana 23 Oct 28, 2022
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page.

Snappy Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. It uses the excellent webkit-based wkhtmltopd

KNP Labs 4.1k Dec 30, 2022
Pdf and graphic files generator library written in php

Information Examples Sample documents are in the "examples" directory. "index.php" file is the web interface to browse examples, "cli.php" is a consol

Piotr Śliwa 335 Nov 26, 2022
HTML to PDF converter for PHP

Dompdf Dompdf is an HTML to PDF converter At its heart, dompdf is (mostly) a CSS 2.1 compliant HTML layout and rendering engine written in PHP. It is

null 9.3k Jan 1, 2023
Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf and wkhtmltoimage wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webk

wkhtmltopdf 13k Jan 4, 2023
Convert html to an image, pdf or string

Convert a webpage to an image or pdf using headless Chrome The package can convert a webpage to an image or pdf. The conversion is done behind the sce

Spatie 4.1k Jan 1, 2023
Laravel package to convert HTML to PDF, supporting multiple drivers.

eve/pdf-converter A Laravel package to help convert HTML to PDF. Supports multiple drivers. Requirements and Installation eve/pdf-converter requires L

eve.io 11 Feb 15, 2022
Convert HTML to PDF using Webkit (QtWebKit)

wkhtmltopdf and wkhtmltoimage wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webk

wkhtmltopdf 13k Jan 9, 2023
plugin de criação de PDF através do HTML fácil

pluginmpdf plugin de criação de PDF através do HTML Para inciar nosso pluginmpdf devemos instalar a lib abaixo. mPDF is a PHP library which generates

EAD TUTORIA 2 Mar 24, 2022
Sign PDF files with valid x509 certificate

Sign PDF files with valid x509 certificate Require this package in your composer.json and update composer. This will download the package and the depe

Lucas Nepomuceno 175 Jan 2, 2023
A Laravel package for creating PDF files using LaTeX

LaraTeX A laravel package to generate PDFs using LaTeX · Report Bug · Request Feature For better visualization you can find a small Demo and the HTML

Ismael Wismann 67 Dec 28, 2022
Simple wrapper package around MPDF's setProtection method that allows you to set password on PDF files

Laravel PDF Protect (fork) Simple wrapper package around MPDF's setProtection method that allows you to set password on PDF files. Installation You ca

Raphael Planer 2 Jan 23, 2022
Offers tools for creating pdf files.

baldeweg/pdf-bundle Offers tools for creating pdf files. Getting Started composer req baldeweg/pdf-bundle Activate the bundle in your config/bundles.p

André Baldeweg 0 Oct 13, 2022
Official clone of PHP library to generate PDF documents and barcodes

TCPDF PHP PDF Library Please consider supporting this project by making a donation via PayPal category Library author Nicola Asuni [email protected] co

Tecnick.com LTD 3.6k Jan 6, 2023
TCPDF - PHP PDF Library - https://tcpdf.org

tc-lib-pdf PHP PDF Library UNDER DEVELOPMENT (NOT READY) UPDATE: CURRENTLY ALL THE DEPENDENCY LIBRARIES ARE ALMOST COMPLETE BUT THE CORE LIBRARY STILL

Tecnick.com LTD 1.3k Dec 30, 2022
PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.

PdfParser Pdf Parser, a standalone PHP library, provides various tools to extract data from a PDF file. Website : https://www.pdfparser.org Test the A

Sebastien MALOT 1.9k Jan 2, 2023
Official clone of PHP library to generate PDF documents and barcodes

TCPDF PHP PDF Library Please consider supporting this project by making a donation via PayPal category Library author Nicola Asuni [email protected] co

Tecnick.com LTD 3.6k Dec 26, 2022