Dompdf v0.7.0-beta3 Release Notes

Release Date: 2016-01-22 // about 8 years ago
  • Change highlights since 0.6.2

    • ⚡️ Incorporate relevant security updates from the 0.6.2 code base
    • ➕ Add namespace support
    • Restructure code for implementation of the PSR coding standard
    • ⬇️ Drop support for the dompdf_config.inc.php configuration file; see the migration section below for more details
    • ✂ Remove non-library utility code (load_font.php, dompdf.php, the www content)
    • ➕ Add initial support for SVG

    🚀 The majority of work in this release went towards support for namespaces, PSR, and SVG support but a few code improvements were also made. Highlights include:

    • ⚡️ Update DejaVu fonts to v2.34
    • 🐎 Optimize performance by removing support for versions of PHP prior to 5.3
    • 👌 Improve PDF structure produced by CPDF
    • ➕ Add rendered document page selection support to the GD adapter
    • 👍 Take Unicode and float support out of "beta"
    • ➕ Add support for unit testing

    Requirements

    The dompdf 0.7.0 beta 3 requires the following:

    • PHP 5.3 or greater
    • MBString
    • GD (for image processing)
    • allow_url_fopen set to true (for retrieving stylesheets or images via http)
    • php-font-lib v0.4.x
    • php-svg-lib v0.1 (if rendering SVG)

    👀 For full requirements and recommendations see the requirements page on the wiki.

    The dompdf team recommends that you use Composer for easier dependency management. If you're not yet using Composer you can download a packaged release of dompdf which includes all the files you need to use the library. The beta package is titled dompdf_0-7-0_beta3.zip.

    Notes on migrating from an earlier version of dompdf

    1. Because the dompdf_config.inc.php file has been removed from this release (and is no longer referenced) all dompdf options will have to be set at run time. To simplify your in-code instantiation you can implement an intermediary script to instantiate dompdf and set the options, referencing this intermediate script in your project. We may provide such a script in the final release to help with migration.
    2. The class naming conventions required a change to the dompdf_font_family_cache.php file. Though we have attempted to accommodate this change your first step when encountering bugs (if you don't know where to start) might be to reset your font directory (i.e. remove custom font files, font metrics files, and the font family cache file). 🚀 3. During the beta period the utilities for pre-loading fonts are not available. We hope to make these utilities available for the final release (in a separate project). You may continue to use the @font-face CSS rule to install fonts at run time. ⚡️ 4. The FontMetrics class is now instantiated instead of static. To simplify migration we provide access to it via the $fontMetrics variable. Please update your embedded scripts. For example, FontMetrics::get_font('helvetica') would now be $fontMetrics->getFont('helvetica').