Skip to content

Commit

Permalink
Expanded supported wkhtmltopdf options
Browse files Browse the repository at this point in the history
  • Loading branch information
stackpr committed Aug 14, 2018
1 parent 0476360 commit 94d45d6
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions src/Engine/Convert/WkHtmlToPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@ class WkHtmlToPdf extends EngineBase {
'mode' => Shell::SHELL_ARG_BASIC_DBL_NOEQUAL,
'default' => '10mm',
),
array(
'name' => 'footer-line',
'description' => 'Display line above the footer',
'mode' => Shell::SHELL_ARG_BOOL_DBL,
),
array(
'name' => 'footer-font-size',
'description' => 'Set footer font size (default 12)',
'mode' => Shell::SHELL_ARG_BASIC_DBL_NOEQUAL,
),
array(
'name' => 'footer-html',
'description' => 'Adds a html footer (must provide URL, not HTML)',
'mode' => Shell::SHELL_ARG_BASIC_DBL_NOEQUAL,
),
array(
'name' => 'footer-left',
'description' => 'Left aligned footer text',
'mode' => Shell::SHELL_ARG_BASIC_DBL_NOEQUAL,
),
array(
'name' => 'footer-center',
'description' => 'Centered footer text',
'mode' => Shell::SHELL_ARG_BASIC_DBL_NOEQUAL,
),
array(
'name' => 'footer-right',
'description' => 'Right aligned footer text',
'mode' => Shell::SHELL_ARG_BASIC_DBL_NOEQUAL,
),
);

public function getConvertFileShell($source, &$destination) {
Expand Down Expand Up @@ -105,14 +135,7 @@ public function getVersionInfo() {
}

public function isAvailable() {
$bin = realpath(__DIR__ . '/../../../../../bin');
if (is_dir($bin) && is_file("$bin/wkhtmltopdf-0.11.0rc1-amd64")) {
$this->cmd = "$bin/wkhtmltopdf-0.11.0rc1-amd64";
}
else {
$this->cmd = $this->shellWhich('wkhtmltopdf');
}

$this->cmd = $this->shellWhich('wkhtmltopdf');
return isset($this->cmd);
}
}

0 comments on commit 94d45d6

Please sign in to comment.