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