diff --git a/Pdf/Engine/WkHtmlToPdfEngine.php b/Pdf/Engine/WkHtmlToPdfEngine.php
index <HASH>..<HASH> 100644
--- a/Pdf/Engine/WkHtmlToPdfEngine.php
+++ b/Pdf/Engine/WkHtmlToPdfEngine.php
@@ -26,14 +26,6 @@ class WkHtmlToPdfEngine extends AbstractPdfEngine {
  * @return string raw pdf data
  */
 	public function output() {
-		$binary = $this->config('binary');
-
-		if ($binary) {
-			$this->binary = $binary;
-		}
-		if (!is_executable($this->binary)) {
-			throw new CakeException(sprintf('wkhtmltopdf binary is not found or not executable: %s', $this->binary));
-		}
 		$content = $this->_exec($this->_getCommand(), $this->_Pdf->html());
 
 		if (strpos(mb_strtolower($content['stderr']), 'error')) {
@@ -82,6 +74,14 @@ class WkHtmlToPdfEngine extends AbstractPdfEngine {
  * @return string the command for generating the pdf
  */
 	protected function _getCommand() {
+		$binary = $this->config('binary');
+
+		if ($binary) {
+			$this->binary = $binary;
+		}
+		if (!is_executable($this->binary)) {
+			throw new CakeException(sprintf('wkhtmltopdf binary is not found or not executable: %s', $this->binary));
+		}
 		$command = $this->binary;
 
 		$command .= " -q";
move binary setting to _getCommand