| <<<Back 1 day (to 2017/11/16) | 20171117 |
halabund | I am running Ghostscript as | 10:21.30 |
| gs -q -o outfile -dNoOutputFonts -sDEVICE=pdfwrite infile | 10:22.00 |
| where infile and outfile are given as absolute paths | 10:22.16 |
| Is there any chance that Ghostscript will attempt to create files in the current directory? | 10:22.47 |
kens | Well, if yo uhave that set as your temporary directory, and depending on the operating system, yes. | 10:23.16 |
halabund | Basically, I wanted to make sure that it is safe to invoke Ghostscript from any directory for as long as the input and output files are given using their absolute paths. | 10:24.52 |
| Itâs okay to write to the temporary directory | 10:25.06 |
kens | That's never guaranteed, because the input file (if PostScript) can open files and read/write to them | 10:25.31 |
halabund | I am thinking of situations where the current directory is not writeable, or where Ghostscript may accidentally leave junk files in the current directory | 10:25.41 |
kens | You can use -dSAFER to prevent access to most of the file system | 10:25.52 |
halabund | The input file is PDF. I should have said that. | 10:25.57 |
kens | I can't recall offhand if that permits writing to the current directory or not | 10:26.05 |
halabund | Didnât know PS can access the file system though ... | 10:26.07 |
kens | PostScript is a complete programming language | 10:26.20 |
| PDF files can contain PostScript XObjects (in earlier versions) which Ghostscritp will execute | 10:26.45 |
halabund | That I know :) But file system access sounds scary. Does PS malware exist? :) | 10:26.54 |
kens | Yes | 10:27.01 |
| Its rare but there have been cases in the wild with Ghostscript | 10:27.15 |
| Hence teh existence of -dSAFER | 10:27.31 |
| Notte that SAFER *only* affects file system access | 10:27.42 |
| If the directory has no write permission then Ghostscritp will raise an ioerror if an attempt is made to write to it. | 10:28.48 |
kruhy | hi, im using pdf creator and ghostscript 9.06. when im doing pdf and adding text as a stamp it rotates all pages. any ideas? | 12:58.30 |
kens | Probably because you have AutoRotatePages set | 13:00.32 |
kruhy | :D i used -dAutoRotatePages=/None and it helped | 14:53.33 |
| thanks :) | 14:53.42 |
| Forward 1 day (to 2017/11/18)>>> | |