You are here

protected function WkhtmltopdfController::getCommandLineArguments in wkhtmltopdf 2.0.x

Gets the command line arguments for the wkhtmltopdf shell command based on the settings

Return value

An associative array where argument name is the array key, and the argument value is the array value. Arguments without values use an empty string for value

1 call to WkhtmltopdfController::getCommandLineArguments()
WkhtmltopdfController::buildShellCommand in src/Controller/WkhtmltopdfController.php
Builds the shell command including parameters

File

src/Controller/WkhtmltopdfController.php, line 204

Class

WkhtmltopdfController
A Controller to generate PDFs and return them as a binary reponse.

Namespace

Drupal\wkhtmltopdf\Controller

Code

protected function getCommandLineArguments() {
  $arguments = [];
  if ($this->settings
    ->get('wkhtmltopdf_zoom')) {
    $arguments['zoom'] = $this->settings
      ->get('wkhtmltopdf_zoom');
  }
  if ($this->settings
    ->get('wkhtmltopdf_printmedia')) {
    $arguments['print-media-type'] = '';
  }
  $this
    ->validateArguments($arguments);
  return $arguments;
}