kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 150 forks source link

Correct Mpdf -> initContsructorParams margin parsing. #60

Closed DaveFerger closed 7 years ago

DaveFerger commented 7 years ago

Scope

This pull request includes a

Changes

The following changes were made (this change is also documented in the change log):

Correct Mpdf -> initContsructorParams margin parsing.

https://github.com/mpdf/mpdf/blob/development/src/Mpdf.php#L1543 :

private function initConstructorParams(array $config)
  {
    $constructor = [
      'mode' => '',
      'format' => 'A4',
      'default_font_size' => 0,
      'default_font' => '',
      'margin_left' => 15,
      'margin_right' => 15,
      'margin_top' => 16,
      'margin_bottom' => 16,
      'margin_header' => 9,
      'margin_footer' => 9,
      'orientation' => 'P',
    ];

    foreach ($constructor as $key => $val) {
      if (isset($config[$key])) {
        $constructor[$key] = $config[$key];
      }
    }

    return array_values($constructor);
  }

Versions

mpdf/mpdf 7.0.x-dev 4b5f88f

kartik-v/yii2-mpdf dev-master 5f3cf0d