コード例 #1
0
ファイル: Page.php プロジェクト: kosikcz/wkhtmltopdf
 /**
  * @param  Document
  * @return string
  */
 public function buildShellArgs(Document $document)
 {
     $file = $this->file;
     if ($file === NULL) {
         $file = $document->saveTempFile((string) $this->html);
     }
     return ($this->isCover ? ' cover ' : ' ') . escapeshellarg($file) . ($this->encoding ? ' --encoding ' . escapeshellarg($this->encoding) : '') . ($this->usePrintMediaType ? ' --print-media-type' : '') . ($this->styleSheet ? ' --user-style-sheet ' . escapeshellarg($this->styleSheet) : '') . ($this->javascript ? ' --run-script ' . escapeshellarg($this->javascript) : '') . ' --zoom ' . $this->zoom * 1;
 }
コード例 #2
0
ファイル: PageMeta.php プロジェクト: kosikcz/wkhtmltopdf
 /**
  * @param  Document
  * @return string
  */
 public function buildShellArgs(Document $document)
 {
     $file = $this->file;
     if ($file === NULL && $this->html !== NULL) {
         $file = $document->saveTempFile((string) $this->html);
     }
     if ($file !== NULL) {
         $cmd = "--{$this->type}-html " . escapeshellarg($file);
     } else {
         $cmd = "--{$this->type}-left " . escapeshellarg($this->left) . " --{$this->type}-center " . escapeshellarg($this->center) . " --{$this->type}-right " . escapeshellarg($this->right);
     }
     $cmd .= ' --' . ($this->line ? '' : 'no-') . "{$this->type}-line";
     if ($this->fontName !== NULL) {
         $cmd .= " --{$this->type}-font-name " . escapeshellarg($this->fontName);
     }
     if ($this->fontSize !== NULL) {
         $cmd .= " --{$this->type}-font-size " . escapeshellarg($this->fontSize);
     }
     return $cmd;
 }