0

I;m tried to use Ghostscript to extract fonts from PDF file. GPL Ghostscript 9.53.3 (2020-10-01) I downloaded extractFonts.ps tool and put it in same folder with PDF file. I also set permissions for extractFonts.ps: 'Allow this file to run as program'. Tried to extract, but got error:

~/Downloads/Helvetica/test$ gs                          \
  -q -dNODISPLAY            \
   /home/labocomp/Downloads/Helvetica/test/extractFonts.ps \
  -c "(/home/labocomp/Downloads/Helvetica/test/10.pdf) extractFonts quit"
Error: /invalidfileaccess in --file--
Operand stack:
   (/home/labocomp/Downloads/Helvetica/test/10.pdf)   (r)
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--
Dictionary stack:
   --dict:730/1123(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
Current allocation mode is local
Last OS error: Permission denied
GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1

Tried also command:

gs -q -dNODISPLAY extractFonts.ps -c "(10.pdf) extractFonts quit
>
>

doesn't extract anything. Where is a problem?

muru
  • 69,900
  • 13
  • 192
  • 292
Lexx Luxx
  • 1,343
  • 11
  • 26
  • 37
  • Does running `gs` under the `strace` command show anything relevant for the system calls related to the file or OS errors reported by ghostscript? – thrig Jul 29 '22 at 17:04
  • `strace` does not show anything: `strace gs -q -dNODISPLAY extractFonts.ps -c "(10.pdf) extractFonts quit` – Lexx Luxx Jul 29 '22 at 20:23

0 Answers0