Skip to content

Commit

Permalink
compatibilizando com o mpdf 7
Browse files Browse the repository at this point in the history
  • Loading branch information
dbemfica committed Feb 4, 2019
1 parent 55a0228 commit caa5ea0
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 78 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ Para fazer instalação do PHPPimaco utilize o composer
```php
composer require proner/phppimaco
```
ou adicione isso ao require do seu composer.json

Caso você precise usar o MPDF na versão 6 use o comando
```php
"require":{
"proner/phppimaco": "dev-master"
}
composer require proner/phppimaco:"^1.2"
```

## Primeira impressão
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"require": {
"php": ">=5.6",
"ext-json": "*",
"mpdf/mpdf": "^6.1",
"mpdf/mpdf": "^7.1",
"picqer/php-barcode-generator": "^0.2.0",
"endroid/qr-code": "^2.5"
},
Expand Down
231 changes: 170 additions & 61 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions src/Pimaco.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace Proner\PhpPimaco;

use mPDF;
use Mpdf\Mpdf;

class Pimaco
{

private $path_template;
private $file_template;
private $content;
Expand Down Expand Up @@ -38,16 +37,14 @@ function __construct($template, $path_template = null)

$this->tags = new \ArrayObject();

$this->pdf = new mPDF(
'utf-8',
array($this->width,$this->height),
$this->fontSize,
null,
$this->marginLeft,
$this->marginRight,
$this->marginTop,
$this->marginBottom
);
$this->pdf = new Mpdf([
'format' => [$this->width, $this->height],
'default_font_size' => $this->fontSize,
'margin_left' => $this->marginLeft,
'margin_right' => $this->marginRight,
'margin_top' => $this->marginTop,
'margin_footer' => $this->marginBottom
]);
}

private function loadConfig()
Expand Down

0 comments on commit caa5ea0

Please sign in to comment.