Ghostscript ERROR: /undefined in --get-- - pdf

I'm trying to use Ghostscript in CentOS. When trying to issue the following Ghostscript command ghostscript -sDEVICE=pcx256 -r150x150 -sOutputFile=OUTPUT_FILE INPUT_PDF I am getting the following error:
ESP Ghostscript 815.02 (2006-04-19)
Copyright (C) 2004 artofcode LLC,
Benicia, CA. All rights reserved.
This software comes with NO WARRANTY:
see the file PUBLIC for details.
Processing pages 1 through 1. Page 1
ERROR: /undefined in --get-- Operand
stack: --dict:8/8(L)--
--dict:8/11(L)-- CS0 --dict:10/10(ro)(G)-- CS0 Execution stack: %interp_exit .runexec2
--nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop
1 3 %oparray_pop 1 3
%oparray_pop --nostringval--
--nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue
--nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval--
false 1 %stopped_push
--nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- Dictionary stack: --dict:1121/1686(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- --dict:107/200(L)-- --dict:104/127(ro)(G)-- --dict:241/347(ro)(G)-- --dict:20/24(L)-- --dict:4/6(L)-- --dict:21/32(L)-- --dict:1/1(ro)(G)-- --dict:3/5(L)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:1/1(ro)(G)-- --dict:8/11(L)-- Current allocation mode is local Last
OS error: 2 ESP Ghostscript 815.02:
Unrecoverable error, exit code 1
Any help is supper appreciated! I've been Googling all weekend for an answer.

Solved it! I had an older version running and I assumed that yum would automatically get the latest n greatest. Removed old version, installed the most current version by building and installing from source. Done.

Related

Am I doing something wrong in gswin64c sDEVICE=pdfwrite?

I've been using Ghostscript in the command line with
gswin64c sDEVICE=pdfwrite -o out.pdf in.pdf
for a long time now with great success. Ghostscript's location is added to the Path variable setting in Windows 10. And today all of a sudden it stopped to work giving the following error message:
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Error: /undefinedfilename in (sDEVICE=pdfwrite)
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:762/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1
What I've tried so far
update Ghostscript from 9.54 to 9.55.0
different input file
rename input file
different folder containing the input file
copying the input file to the \gs9.55.0\bin\ folder
running the command line with admin privs
running windows logged in as admin
All to no success and always giving me the same error message. All the files tried are being displayed correctly in any pdf viewer.
What am I doing wrong here? And why suddendly?
Easily done but read the error undefinedfilename in (sDEVICE=pdfwrite)
Whilst not very clear, it thinks you are asking for that file to be processed.
However you should have just like for the -o output file switch added the switch - signal.
Then if there is no IN file the message changes
gswin64c -sDEVICE=pdfwrite -o out.pdf in.pdf
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Error: /undefinedfilename in (in.pdf)
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:764/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.55.0: Unrecoverable error, exit code 1
Just a side note that it can sometimes reduce later issues if you get into the habit of using
gswin64c -sDEVICE=pdfwrite -o"out.pdf" -f"in.pdf"

convert: no images defined for making a PDF thumbnail in CentOS

When converting a PDF to a jpg thumbnail, this error occurs:
/usr/bin/convert '/large/sourcefolder/1383f07adadae238d4f27f188c3a0496/a_named_file.pdf' qqq.jpg
convert: Postscript delegate failed `[ghostscript library 9.25] -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' '-sOutputFile=/tmp/magick-31299555NM5LlPyTO%d' '-f/tmp/magick-31299wBWMEYcB31Fp' '-f/tmp/magick-31299VUJc3QY8sCs0'': Error: /undefined in 1f7424cb60beea75a472e08293b2ff51a:7:
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 2047 1 3 %oparray_pop 2046 1 3 %oparray_pop 2026 1 3 %oparray_pop 1884 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:956/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
Current allocation mode is local
Current file position is 36
GPL Ghostscript 9.25: Unrecoverable error, exit code 1
# error/ghostscript-private.h/InvokeGhostscriptDelegate/171.
convert: no images defined `qqq.jpg' # error/convert.c/ConvertImageCommand/3235.
Sometimes it does convert, and other times not, it is rather fuzzy.
Ghostscript is found, as it is in the same path as convert.
The used OS is Centos 7.
uname -av
Linux my.example.com 4.15.18-15-pve #1 SMP PVE 4.15.18-40 (Tue, 21 May 2019 17:43:20 +0200) x86_64 x86_64 x86_64 GNU/Linux

Exceeding the size of vendor

Hi I couldn't change size or divide vendor in nuxt what makes server doesn't want to load and after few seconds quit.
The issue is I was about introducing nuxt auth when the server unluckily returned this. terminal response is below.
Earlier everything works good but unexpectedly doesn't want to load and after few seconds server quits every time I tried to run this app.
In addition even after removing part of code before server runs good, this error still occurs or after creating new project vendor is still to big but everything works until exceeding size a bit by adding some file.
I found out this issue is connected to the size of the vendor and
tried to modify build in nuxt.config.js to change size of chunks or even try to divide it to smaller part but nothing works.
Does anybody know how to fix it?
Thanks in advance.
In npm run generate
13:54:04 ✔ Nuxt files generated
✔ Client
Compiled successfully in 18.61s
✔ Server
Compiled successfully in 11.82s
13:54:17 WARN Unable to update lock within the stale threshold
at options.fs.stat (node_modules/proper-lockfile/lib/lockfile.js:136:25)
at node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:154:5)
Hash: a63f30e1da8b54b4e1e5
Version: webpack 4.31.0
Time: 18616ms
Built at: 2019-05-12 13:54:26
Asset Size Chunks Chunk Names
../server/client.manifest.json 18.5 KiB [emitted]
19efd8abbee3a8a33be4.js 1.66 KiB 4 [emitted] pages/register
35ca09b69194d90b94ba.js 284 bytes 2 [emitted] pages/index
3e8ab344ce99545b414a.js 189 KiB 1 [emitted] commons.app
40bd82d4e1d1a04a75a9.js 2.27 KiB 5 [emitted] runtime
LICENSES 2.26 KiB [emitted]
be138e70225ef677bf11.js 49.2 KiB 0 [emitted] app
ea98f7e0cb05705cdd19.js 2.09 KiB 3 [emitted] pages/login
ebfb93d5cff67de3634c.js 413 KiB 6 [emitted] [big] vendors.app
+ 2 hidden assets
Entrypoint app = 40bd82d4e1d1a04a75a9.js 3e8ab344ce99545b414a.js ebfb93d5cff67de3634c.js be138e70225ef677bf11.js
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
ebfb93d5cff67de3634c.js (413 KiB)
Hash: 2686db6f213979a0c61c
Version: webpack 4.31.0
Time: 11817ms
Built at: 2019-05-12 13:54:38
Asset Size Chunks Chunk Names
451e987fc41d64bb12d2.js 1.35 KiB 2 [emitted] pages/login
6365a6c7ab9c235b4be2.js 330 bytes 1 [emitted] pages/index
b65301e6570f75dc06a3.js 1.61 KiB 3 [emitted] pages/register
server.js 398 KiB 0 [emitted] app
server.manifest.json 483 bytes [emitted]
+ 4 hidden assets
Entrypoint app = server.js server.js.map
13:54:38 ℹ Generating pages
13:54:40 ✔ Generated /login
13:54:40 ✔ Generated /register
13:54:40 ✔ Generated /
and after npm run dev
13:48:02 ℹ Preparing project for development
13:48:02 ℹ Initial build may take a while
13:48:02 ✔ Builder initialized
13:48:02 ✔ Nuxt files generated
✔ Client
Compiled successfully in 7.71s
✔ Server
Compiled successfully in 5.85s
13:48:16 ℹ Waiting for file changes
13:48:16 ℹ Memory usage: 151 MB (RSS: 260 MB)
<--- Last few GCs --->
[4505:0x10264a000] 79635 ms: Mark-sweep 1264.9 (1425.4) -> 1264.0 (1425.9) MB, 1629.7 / 0.2 ms (average mu = 0.216, current mu = 0.135) allocation failure scavenge might not succeed
[4505:0x10264a000] 81812 ms: Mark-sweep 1265.2 (1425.9) -> 1264.8 (1427.4) MB, 1912.8 / 0.3 ms (average mu = 0.168, current mu = 0.121) deserialize GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x41f436e5261]
Security context: 0x30d36aa9e6e9 <JSObject>
1: createContext(aka createContext) [0x30d31809fa31] [vm.js:~240] [pc=0x41f435541c1](this=0x30d36df826f1 <undefined>,/* anonymous */=0x30d33fda7019 <Object map = 0x30d3de4c0fd1>,/* anonymous */=0x30d33fda7121 <Object map = 0x30d36ac02571>)
2: runInNewContext [0x30d3180823e9] [vm.js:135] [bytecode=0x30d3452e00c9 offset=15](this=0x30d35c4822a1 <Contexti...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x10003c597 node::Abort() [/usr/local/bin/node]
2: 0x10003c7a1 node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
3: 0x1001ad575 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0x100579242 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
5: 0x10057bd15 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/bin/node]
6: 0x100577bbf v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
7: 0x100575d94 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
8: 0x100579172 v8::internal::Heap::ReserveSpace(std::__1::vector<v8::internal::Heap::Chunk, std::__1::allocator<v8::internal::Heap::Chunk> >*, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >*) [/usr/local/bin/node]
9: 0x100855687 v8::internal::DefaultDeserializerAllocator::ReserveSpace() [/usr/local/bin/node]
10: 0x10085e035 v8::internal::PartialDeserializer::Deserialize(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSGlobalProxy>, v8::DeserializeInternalFieldsCallback) [/usr/local/bin/node]
11: 0x10085dfd4 v8::internal::PartialDeserializer::DeserializeContext(v8::internal::Isolate*, v8::internal::SnapshotData const*, bool, v8::internal::Handle<v8::internal::JSGlobalProxy>, v8::DeserializeInternalFieldsCallback) [/usr/local/bin/node]
12: 0x100867455 v8::internal::Snapshot::NewContextFromSnapshot(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSGlobalProxy>, unsigned long, v8::DeserializeInternalFieldsCallback) [/usr/local/bin/node]
13: 0x100233c36 v8::internal::Genesis::Genesis(v8::internal::Isolate*, v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, unsigned long, v8::DeserializeInternalFieldsCallback, v8::internal::GlobalContextType) [/usr/local/bin/node]
14: 0x100217f91 v8::internal::Bootstrapper::CreateEnvironment(v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, v8::ExtensionConfiguration*, unsigned long, v8::DeserializeInternalFieldsCallback, v8::internal::GlobalContextType) [/usr/local/bin/node]
15: 0x1001cd8c7 v8::NewContext(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocal<v8::ObjectTemplate>, v8::MaybeLocal<v8::Value>, unsigned long, v8::DeserializeInternalFieldsCallback) [/usr/local/bin/node]
16: 0x1001af159 v8::Context::New(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocal<v8::ObjectTemplate>, v8::MaybeLocal<v8::Value>, v8::DeserializeInternalFieldsCallback) [/usr/local/bin/node]
17: 0x1000422d1 node::NewContext(v8::Isolate*, v8::Local<v8::ObjectTemplate>) [/usr/local/bin/node]
18: 0x10006345b node::contextify::ContextifyContext::CreateV8Context(node::Environment*, v8::Local<v8::Object>, node::contextify::ContextOptions const&) [/usr/local/bin/node]
19: 0x10006324f node::contextify::ContextifyContext::ContextifyContext(node::Environment*, v8::Local<v8::Object>, node::contextify::ContextOptions const&) [/usr/local/bin/node]
20: 0x100064ab1 node::contextify::ContextifyContext::MakeContext(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
21: 0x41f436e5261
22: 0x41f435541c1
23: 0x41f42d918d5
Abort trap: 6
and also terminal response after making new nuxt project and run npm run generate
✔ Client
Compiled successfully in 19.49s
✔ Server
Compiled successfully in 12.06s
14:31:30 ERROR (node:5036) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead
14:31:34 WARN Unable to update lock within the stale threshold
at options.fs.stat (node_modules/proper-lockfile/lib/lockfile.js:136:25)
at node_modules/graceful-fs/polyfills.js:285:20
at FSReqWrap.oncomplete (fs.js:154:5)
Hash: 523464a4f215ecad138a
Version: webpack 4.31.0
Time: 19497ms
Built at: 2019-05-12 14:31:49
Asset Size Chunks Chunk Names
../server/client.manifest.json 17.2 KiB [emitted]
5359710684b4ec80d12c.js 2.22 KiB 3 [emitted] runtime
5ad858d838bf3e368436.js 3.65 KiB 2 [emitted] pages/index
6773aee58a76de65a958.js 164 KiB 1 [emitted] commons.app
6953a06a30bda4b69151.js 413 KiB 4 [emitted] [big] vendors.app
7ec00afb1f7acea69260.js 34.1 KiB 0 [emitted] app
LICENSES 1.8 KiB [emitted]
icons/icon_120.9mld2VBMsQ$.png 3.05 KiB [emitted]
icons/icon_144.9mld2VBMsQ$.png 3.78 KiB [emitted]
icons/icon_152.9mld2VBMsQ$.png 3.96 KiB [emitted]
icons/icon_192.9mld2VBMsQ$.png 5.01 KiB [emitted]
icons/icon_384.9mld2VBMsQ$.png 11 KiB [emitted]
icons/icon_512.9mld2VBMsQ$.png 13.9 KiB [emitted]
icons/icon_64.9mld2VBMsQ$.png 1.61 KiB [emitted]
manifest.89571180.json 831 bytes [emitted]
+ 2 hidden assets
Entrypoint app = 5359710684b4ec80d12c.js 6773aee58a76de65a958.js 6953a06a30bda4b69151.js 7ec00afb1f7acea69260.js
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
6953a06a30bda4b69151.js (413 KiB)
Hash: 86e05930b1fece3cf75c
Version: webpack 4.31.0
Time: 12068ms
Built at: 2019-05-12 14:32:01
Asset Size Chunks Chunk Names
7d1bee16c2e1af97f877.js 3.71 KiB 1 [emitted] pages/index
server.js 386 KiB 0 [emitted] app
server.manifest.json 243 bytes [emitted]
+ 2 hidden assets
Entrypoint app = server.js server.js.map
14:32:01 ℹ Generating pages
14:32:02 ✔ Generated /
You could try this config in nuxt.config.js to enforce a size on the build chunks
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend (config, ctx) {
if (ctx && ctx.isClient) {
config.optimization.splitChunks.maxSize = 64000
}
}
}

GraphicsMagick: Cannot convert pdf to jpeg

I am trying to convert a pdf document ( 95 pages ) to multiple JPEG files, but getting error:
$gm convert -verbose -density 300 TESTIO.pdf +adjoin FOO-%02d.jpg
[ghostscript library] "-q" "-dBATCH" "-dSAFER" "-dMaxBitmap=50000000" "-dNOPAUSE" "-sDEVICE=pnmraw" "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4" "-r300x300" "-sOutputFile=/tmp/gm2BfrxJ" "--" "/tmp/gmWNsJU0" "-c" "quit"Error: /ioerror in --showpage--
Operand stack:
1 true
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 24 1 95 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- 1745 0 9 %oparray_pop --nostringval-- --nostringval--
Dictionary stack:
--dict:1154/1684(ro)(G)-- --dict:1/20(G)-- --dict:76/200(L)-- --dict:76/200(L)-- --dict:106/127(ro)(G)-- --dict:286/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- --dict:22/40(L)--
Current allocation mode is local
Last OS error: 28
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
gm convert: Unexpected end-of-file (/tmp/gm2BfrxJ).
Here is the config for GraphicsMagick:
$gm version
GraphicsMagick 1.3.25 2016-09-05 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2016 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
Native Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP no
DPS no
FlashPix no
FreeType no
Ghostscript (Library) yes
JBIG no
JPEG-2000 no
JPEG yes
Little CMS no
Loadable Modules no
OpenMP yes (200805)
PNG no
TIFF yes
TRIO no
UMEM no
WebP no
WMF no
X11 no
XML no
ZLIB no
Host type: x86_64-unknown-linux-gnu
Configured using the command:
./configure '--prefix=/usr/local' '--with-modules=yes' '--with-libtiff' '--with-jpeg' '--with-gslib'
Final Build Parameters:
CC = gcc -std=gnu99
CFLAGS = -fopenmp -g -O2 -Wall -pthread
CPPFLAGS =
CXX = g++
CXXFLAGS = -pthread
LDFLAGS =
LIBS = -ltiff -ljpeg -lgs -lm -lgomp -lpthread
also:
$ gs -version
GPL Ghostscript 9.20 (2016-09-26)
Copyright (C) 2016 Artifex Software, Inc. All rights reserved.
Firstly, you are using an ancient version of Ghostscript in your GraphicsMagick. I know that version has returned 9.20, but if you look in the error log you posted you will see "GPL Ghostscript 8.70: Unrecoverable error, exit code 1". So your GraphicsMagick installation is using 8.70.
This looks to me like its caused by the fact that all the output files are being sent to the same filename. The switch -sOutputFile=/tmp/gm2BfrxJ will write all the pages to a single file. If you want them to go to multiple files then you need to specify multiple page output, eg -sOutputFile=/tmp/gm2BfrxJ-%d or similar.
I suspect the problem is simply that GraphicsMagick isn't set up to deal with multiple page files like this. Do the conversion one page at a time. Or have Ghostscript render the pages to JPEG for you.

Ghostscript merge pdf font error: How to define fallback font

How do you give tell ghostscript to use a "fallback" font if a font can't be found?
When executing this Ghostscript command:
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/output.pdf /input_pdf_with_missing_font.pdf
I am receiving this error:
Error: /undefined in findresource Operand stack: --dict:9/18(L)-- C2_0 1 --dict:6/6(L)-- --dict:6/6(L)-- ArialUnicodeMS --dict:11/12(ro)(G)-- --nostringval-- CIDFontObject --dict:8/8(L)-- --dict:8/8(L)-- Adobe-Identity Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 3 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %array_continue --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue Dictionary stack: --dict:1149/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:286/300(ro)(G)-- --dict:22/25(L)-- --dict:4/6(L)-- --dict:26/40(L)-- Current allocation mode is local Last OS error: 2 GPL Ghostscript 8.70: Unrecoverable error, exit code 1
You need a newer version of Ghostscript (it would help with these sorts of questions if you would state the version in use).
You appear to be using version 8.70 which is now more than 7 years old, the current version is 9.20. The current version ships with a default CIDFont (your PDF file fails to embed a CIDFont, not a Font).
You will have to check the documentation supplied with Ghostscript 8.70 to see how to define substitute resources (see the Ghostscript installation folder and then the 'doc' subfolder), I don't recall if the current method works with such an archaic version. However the current version documentation on CIDFont substitution can also be found here
I took #KenS's advice and installed Ghostscript to 9.20 (I wanted to keep the old version in place for other legacy projects)
Here are the steps (I followed these instructions):
Locate the source package of GS: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases
In my case: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9.20.tar.gz
Run the following commands:
cd /tmp
wget
https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs920/ghostscript-9.20.tar.gz
tar xzf ghostscript-9.20.tar.gz
cd ghostscript-9.20
./configure --prefix=/usr/bin/gs9
make
sudo make install
And to run the new version:
/usr/bin/gs9/bin/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=/some/target/file.pdf /some/source/file.php
And no more font issues!!