Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Nette\Object;
- use Wkhtmltopdf\Document;
- class WkhtmltopdfFactory extends Object
- {
- /**
- * @var string
- */
- private $tempDir;
- /**
- * @var string
- */
- private $executable;
- /**
- * @param string $tempDir
- * @param string $executable
- */
- public function __construct($tempDir, $executable)
- {
- if (!is_dir($this->tempDir = $tempDir)) {
- mkdir($tempDir, 0777, TRUE);
- }
- $this->executable = $executable;
- }
- /**
- * @return Document
- */
- public function create()
- {
- $document = new Document($this->tempDir);
- $document::$executable = $this->executable;
- return $document;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment