Skip to content

Commit

Permalink
Merge pull request #28673 from bb/migrate-snappy-to-composer
Browse files Browse the repository at this point in the history
Migrate Snappy to composer
  • Loading branch information
demeritcowboy authored Dec 26, 2023
2 parents 8aace48 + abb4d9c commit 4946367
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 3 deletions.
1 change: 0 additions & 1 deletion CRM/Utils/PDF/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ public static function _html2pdf_weasyprint($html, $output, $fileName) {
* @param string $fileName
*/
public static function _html2pdf_wkhtmltopdf($paper_size, $orientation, $margins, $html, $output, $fileName) {
require_once 'snappy/src/autoload.php';
$snappy = new Knp\Snappy\Pdf(\Civi::settings()->get('wkhtmltopdfPath'));
$snappy->setOption("page-width", $paper_size[2] . "pt");
$snappy->setOption("page-height", $paper_size[3] . "pt");
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"soundasleep/html2text": "^2.1",
"psr/container": "~1.0 || ~2.0",
"ext-fileinfo": "*",
"pontedilana/php-weasyprint": "^0.13.0"
"pontedilana/php-weasyprint": "^0.13.0",
"knplabs/knp-snappy": "^1.4"
},
"scripts": {
"post-install-cmd": [
Expand Down
76 changes: 75 additions & 1 deletion composer.lock

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

0 comments on commit 4946367

Please sign in to comment.