1 | <?php |
||
16 | trait OtherTrait |
||
17 | { |
||
18 | /** |
||
19 | * Whether argument is set |
||
20 | * |
||
21 | * @param string $name |
||
22 | * |
||
23 | * @return bool |
||
24 | */ |
||
25 | abstract protected function hasArgument($name); |
||
26 | |||
27 | /** |
||
28 | * Get argument value |
||
29 | * |
||
30 | * @param string $name |
||
31 | * |
||
32 | * @return null|string |
||
33 | */ |
||
34 | abstract protected function getArgumentValue($name); |
||
35 | |||
36 | /** |
||
37 | * Set argument |
||
38 | * |
||
39 | * @param string $argument |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | abstract protected function setArgument($argument); |
||
44 | |||
45 | /** |
||
46 | * Whether FILTERIMAGE flag is set |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function isFilterImage() |
||
54 | |||
55 | /** |
||
56 | * Set FILTERIMAGE flag |
||
57 | * |
||
58 | * If set, ths will ignore all images in the input (in this context image means a bitmap), these will therefore not |
||
59 | * be rendered. |
||
60 | * |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function setFilterImage() |
||
69 | |||
70 | /** |
||
71 | * Whether FILTERTEXT flag is set |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function isFilterText() |
||
79 | |||
80 | /** |
||
81 | * Set FILTERTEXT flag |
||
82 | * |
||
83 | * If set, ths will ignore all text in the input (just because it looks like text doesn't mean it is, it might be an |
||
84 | * image), text will therefore not be rendered. |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function setFilterText() |
||
94 | |||
95 | /** |
||
96 | * Whether FILTERVECTOR flag is set |
||
97 | * |
||
98 | * @return bool |
||
99 | */ |
||
100 | public function isFilterVector() |
||
104 | |||
105 | /** |
||
106 | * Set FILTERVECTOR flag |
||
107 | * |
||
108 | * If set, ths will ignore anything whch is neither text nor an image. |
||
109 | * |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function setFilterVector() |
||
118 | |||
119 | /** |
||
120 | * Whether DELAYBIND flag is set |
||
121 | * |
||
122 | * @return bool |
||
123 | */ |
||
124 | public function isDelayBind() |
||
128 | |||
129 | /** |
||
130 | * Set DELAYBIND flag |
||
131 | * |
||
132 | * Causes bind to remember all its invocations, but not actually execute them until the .bindnow procedure is |
||
133 | * called. Useful only for certain specialized packages like pstotext that redefine operators. See the documentation |
||
134 | * for .bindnow for more information on using this feature. |
||
135 | * |
||
136 | * @return $this |
||
137 | */ |
||
138 | public function setDelayBind() |
||
144 | |||
145 | /** |
||
146 | * Whether DOPDFMARKS flag is set |
||
147 | * |
||
148 | * @return bool |
||
149 | */ |
||
150 | public function isDoPdfMarks() |
||
154 | |||
155 | /** |
||
156 | * Set DOPDFMARKS flag |
||
157 | * |
||
158 | * Causes pdfmark to be called for bookmarks, annotations, links and cropbox when processing PDF files. Normally, |
||
159 | * pdfmark is only called for these types for PostScript files or when the output device requests it (e.g. pdfwrite |
||
160 | * device). |
||
161 | * |
||
162 | * @return $this |
||
163 | */ |
||
164 | public function setDoPdfMarks() |
||
170 | |||
171 | /** |
||
172 | * Whether JOBSERVER flag is set |
||
173 | * |
||
174 | * @return bool |
||
175 | */ |
||
176 | public function isJobServer() |
||
180 | |||
181 | /** |
||
182 | * Set JOBSERVER flag |
||
183 | * |
||
184 | * Define \004 (^D) to start a new encapsulated job used for compatibility with Adobe PS Interpreters that |
||
185 | * ordinarily run under a job server. The -dNOOUTERSAVE switch is ignored if -dJOBSERVER is specified since job |
||
186 | * servers always execute the input PostScript under a save level, although the exitserver operator can be used to |
||
187 | * escape from the encapsulated job and execute as if the -dNOOUTERSAVE was specified. |
||
188 | * |
||
189 | * This also requires that the input be from stdin, otherwise an error will result |
||
190 | * (Error: /invalidrestore in --restore--). |
||
191 | * |
||
192 | * Example usage is: |
||
193 | * |
||
194 | * gs ... -dJOBSERVER - < inputfile.ps |
||
195 | * -or- |
||
196 | * cat inputfile.ps | gs ... -dJOBSERVER - |
||
197 | * |
||
198 | * Note: The ^D does not result in an end-of-file action on stdin as it may on some PostScript printers that rely on |
||
199 | * TBCP (Tagged Binary Communication Protocol) to cause an out-of-band ^D to signal EOF in a stream input data. This |
||
200 | * means that direct file actions on stdin such as flushfile and closefile will affect processing of data beyond the |
||
201 | * ^D in the stream. |
||
202 | * |
||
203 | * @return $this |
||
204 | */ |
||
205 | public function setJobServer() |
||
211 | |||
212 | /** |
||
213 | * Whether NOBIND flag is set |
||
214 | * |
||
215 | * @return bool |
||
216 | */ |
||
217 | public function isNoBind() |
||
221 | |||
222 | /** |
||
223 | * Set NOBIND flag |
||
224 | * |
||
225 | * Disables the bind operator. Useful only for debugging. |
||
226 | * |
||
227 | * @return $this |
||
228 | */ |
||
229 | public function setNoBind() |
||
235 | |||
236 | /** |
||
237 | * Whether NOCACHE flag is set |
||
238 | * |
||
239 | * @return bool |
||
240 | */ |
||
241 | public function isNoCache() |
||
245 | |||
246 | /** |
||
247 | * Set NOCACHE flag |
||
248 | * |
||
249 | * Disables character caching. Useful only for debugging. |
||
250 | * |
||
251 | * @return $this |
||
252 | */ |
||
253 | public function setNoCache() |
||
259 | |||
260 | /** |
||
261 | * Whether NOGC flag is set |
||
262 | * |
||
263 | * @return bool |
||
264 | */ |
||
265 | public function isNoGc() |
||
269 | |||
270 | /** |
||
271 | * Set NOGC flag |
||
272 | * |
||
273 | * Suppresses the initial automatic enabling of the garbage collector in Level 2 systems. (The vmreclaim operator is |
||
274 | * not disabled.) Useful only for debugging. |
||
275 | * |
||
276 | * @return $this |
||
277 | */ |
||
278 | public function setNoGc() |
||
284 | |||
285 | /** |
||
286 | * Whether NOOUTERSAVE flag is set |
||
287 | * |
||
288 | * @return bool |
||
289 | */ |
||
290 | public function isNoOuterSave() |
||
294 | |||
295 | /** |
||
296 | * Set NOOUTERSAVE flag |
||
297 | * |
||
298 | * Suppresses the initial save that is used for compatibility with Adobe PS Interpreters that ordinarily run under a |
||
299 | * job server. If a job server is going to be used to set up the outermost save level, then -dNOOUTERSAVE should be |
||
300 | * used so that the restore between jobs will restore global VM as expected. |
||
301 | * |
||
302 | * @return $this |
||
303 | */ |
||
304 | public function setNoOuterSave() |
||
310 | |||
311 | /** |
||
312 | * Whether NOSAFER flag is set |
||
313 | * |
||
314 | * @return bool |
||
315 | */ |
||
316 | public function isNoSafer() |
||
320 | |||
321 | /** |
||
322 | * Set NOSAFER flag (equivalent to DELAYSAFER) |
||
323 | * |
||
324 | * This flag disables SAFER mode until the .setsafe procedure is run. This is intended for clients or scripts that |
||
325 | * cannot operate in SAFER mode. If Ghostscript is started with -dNOSAFER or -dDELAYSAFER, PostScript programs are |
||
326 | * allowed to read, write, rename or delete any files in the system that are not protected by operating system |
||
327 | * permissions. |
||
328 | * |
||
329 | * This mode should be used with caution, and .setsafe should be run prior to running any PostScript file with |
||
330 | * unknown contents. |
||
331 | * |
||
332 | * @return $this |
||
333 | */ |
||
334 | public function setNoSafer() |
||
340 | |||
341 | /** |
||
342 | * Whether SAFER flag is set |
||
343 | * |
||
344 | * @return bool |
||
345 | */ |
||
346 | public function isSafer() |
||
350 | |||
351 | /** |
||
352 | * Set SAFER flag |
||
353 | * |
||
354 | * Disables the deletefile and renamefile operators, and the ability to open piped commands (%pipe%cmd) at all. Only |
||
355 | * %stdout and %stderr can be opened for writing. Disables reading of files other than %stdin, those given as a |
||
356 | * command line argument, or those contained on one of the paths given by LIBPATH and FONTPATH and specified by the |
||
357 | * system params /FontResourceDir and /GenericResourceDir. |
||
358 | * |
||
359 | * This mode also sets the .LockSafetyParams parameter of the default device, or the device specified with the |
||
360 | * -sDEVICE= switch to protect against programs that attempt to write to files using the OutputFile device |
||
361 | * parameter. Note that since the device parameters specified on the command line (including OutputFile) are set |
||
362 | * prior to SAFER mode, the -sOutputFile=... on the command line is unrestricted. |
||
363 | * |
||
364 | * SAFER mode also prevents changing the /GenericResourceDir, /FontResourceDir and either the /SystemParamsPassword |
||
365 | * or the /StartJobPassword. |
||
366 | * |
||
367 | * Note: While SAFER mode is not the default, in a subsequent release of Ghostscript, SAFER mode will be the default |
||
368 | * thus scripts or programs that need to open files or set restricted parameters will require the -dNOSAFER command |
||
369 | * line option. |
||
370 | * |
||
371 | * When running -dNOSAFER it is possible to perform a save, followed by .setsafe, execute a file or procedure in |
||
372 | * SAFER mode, then use restore to return to NOSAFER mode. In order to prevent the save object from being restored |
||
373 | * by the foreign file or procedure, the .runandhide operator should be used to hide the save object from the |
||
374 | * restricted procedure. |
||
375 | * |
||
376 | * @return $this |
||
377 | */ |
||
378 | public function setSafer() |
||
384 | |||
385 | /** |
||
386 | * Whether PreBandThreshold flag is true |
||
387 | * |
||
388 | * @return bool |
||
389 | */ |
||
390 | public function isPreBandThreshold() |
||
399 | |||
400 | /** |
||
401 | * Set PreBandThreshold flag |
||
402 | * |
||
403 | * If the target device is a halftone device, then images that are normally stored in the command list during banded |
||
404 | * output will be halftoned during the command list writing phase, if the resulting image will result in a smaller |
||
405 | * command list. The decision to halftone depends upon the output and source resolution as well as the output and |
||
406 | * source color space. |
||
407 | * |
||
408 | * @param bool $preBandThreshold |
||
409 | * |
||
410 | * @return $this |
||
411 | */ |
||
412 | public function setPreBandThreshold($preBandThreshold) |
||
418 | |||
419 | /** |
||
420 | * Whether STRICT flag is set |
||
421 | * |
||
422 | * @return bool |
||
423 | */ |
||
424 | public function isStrict() |
||
428 | |||
429 | /** |
||
430 | * Set STRICT flag |
||
431 | * |
||
432 | * Disables as many Ghostscript extensions as feasible, to be more helpful in debugging applications that produce |
||
433 | * output for Adobe and other RIPs. |
||
434 | * |
||
435 | * @return $this |
||
436 | */ |
||
437 | public function setStrict() |
||
443 | |||
444 | /** |
||
445 | * Whether WRITESYSTEMDICT flag is set |
||
446 | * |
||
447 | * @return bool |
||
448 | */ |
||
449 | public function isWriteSystemDict() |
||
453 | |||
454 | /** |
||
455 | * Set WRITESYSTEMDICT flag |
||
456 | * |
||
457 | * Leaves systemdict writable. This is necessary when running special utility programs such as font2c and pcharstr, |
||
458 | * which must bypass normal PostScript access protection. |
||
459 | * |
||
460 | * @return $this |
||
461 | */ |
||
462 | public function setWriteSystemDict() |
||
468 | } |
||
469 |