protected function _getCommand($in)
{
$command = '';
$command = $this->getBin();
$command .= " --orientation " . escapeshellarg($this->getOrientation());
$command .= " --page-size " . escapeshellarg($this->getPageSize());
$command .= $this->getTOC() ? " --toc" : "";
$command .= $this->getGrayscale() ? " --grayscale" : "";
$command .= $this->getTitle() ? ' --title "' . escapeshellarg($this->getTitle()) . '"' : "";
$command .= $this->getCopies() > 1 ? " --copies " . escapeshellarg($this->getCopies()) : "";
$command .= strlen($this->getPassword()) > 0 ? " --password " . escapeshellarg($this->getPassword()) . "" : "";
$command .= strlen($this->getUsername()) > 0 ? " --username " . escapeshellarg($this->getUsername()) . "" : "";
$command .= $this->_have_headerhtml ? " --margin-top 20 --header-html " . escapeshellarg($this->_headerfilename) : "";
$command .= $this->_have_footerhtml ? " --margin-bottom 20 --footer-html " . escapeshellarg($this->_footerfilename) : "";
$command .= $this->getOptions() ? " {$this->getOptions()} " : "";
/*
* ignore some errors with some urls as recommended with this wkhtmltopdf error message:
* Error: Failed loading page <url> (sometimes it will work just to ignore this error with --load-error-handling ignore)
*/
if ($this->getHttpUrl()) {
// $command .= ' --load-error-handling ignore';
}
$command .= ' "' . $in . '" ';
$command .= " -";
return $command;
}