1 | <?php |
||
22 | class Ghostscript |
||
23 | { |
||
24 | /** |
||
25 | * The default binary. |
||
26 | */ |
||
27 | const DEFAULT_BINARY = 'gs'; |
||
28 | |||
29 | /** |
||
30 | * The versions. |
||
31 | * |
||
32 | * @var string[] |
||
33 | */ |
||
34 | protected static $versions = []; |
||
35 | |||
36 | /** |
||
37 | * The options. |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $options; |
||
42 | |||
43 | /** |
||
44 | * Create Ghostscript object. |
||
45 | * |
||
46 | * @param array $options |
||
47 | * |
||
48 | * @throws \RuntimeException |
||
49 | */ |
||
50 | 28 | public function __construct(array $options = []) |
|
58 | |||
59 | /** |
||
60 | * Get option. |
||
61 | * |
||
62 | * @param string $name |
||
63 | * @param mixed $default |
||
64 | * |
||
65 | * @return mixed |
||
66 | */ |
||
67 | 26 | public function getOption($name, $default = null) |
|
75 | |||
76 | /** |
||
77 | * Get process to identify version. |
||
78 | * |
||
79 | * @param string $binary |
||
80 | * |
||
81 | * @return Process |
||
82 | */ |
||
83 | 2 | protected function createProcessToIdentifyVersion($binary) |
|
87 | |||
88 | /** |
||
89 | * Get version. |
||
90 | * |
||
91 | * @throws \RuntimeException |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | 26 | public function getVersion() |
|
112 | |||
113 | /** |
||
114 | * Create arguments object. |
||
115 | * |
||
116 | * @return Arguments |
||
117 | */ |
||
118 | 16 | protected function createArguments() |
|
128 | |||
129 | /** |
||
130 | * Create PDF device object. |
||
131 | * |
||
132 | * @param null|string $outputFile |
||
133 | * |
||
134 | * @return PdfWrite |
||
135 | */ |
||
136 | 8 | public function createPdfDevice($outputFile = null) |
|
152 | |||
153 | /** |
||
154 | * Create no display device object. |
||
155 | * |
||
156 | * @return NoDisplay |
||
157 | */ |
||
158 | 2 | public function createNoDisplayDevice() |
|
162 | |||
163 | /** |
||
164 | * Create PDF info device object. |
||
165 | * |
||
166 | * @param string $pdfInfoPath Path to toolbin/pdf_info.ps |
||
167 | * |
||
168 | * @return PdfInfo |
||
169 | */ |
||
170 | 2 | public function createPdfInfoDevice($pdfInfoPath) |
|
174 | |||
175 | /** |
||
176 | * Create bounding box info device object. |
||
177 | * |
||
178 | * @return BoundingBoxInfo |
||
179 | */ |
||
180 | 2 | public function createBoundingBoxInfoDevice() |
|
190 | } |
||
191 |