Sérgio Abreu
Sérgio Abreu

Reputation: 177

Ghostscript error reading a content stream

I'm try to compact a PDF using Ghostscript however an error appears when executing the command. I'm using ubuntu 18.04, gs version 9.27.

When using debug parameter, show the log below:

FAPIhook --nostringval--
Font --nostringval-- ( aliased from DAAAAA+LiberationSerif ) is mapped to FAPI=FreeType

FAPIhook --nostringval--
Font --nostringval-- ( aliased from DAAAAA+LiberationSerif ) is mapped to FAPI=FreeType
Has GlyphNames2Unicode
(\001) Tj
   **** Error reading a content stream. The page may be incomplete.
               Output may be incorrect.
   **** Error: File did not complete the page properly and may be damaged.
               Output may be incorrect.
%Resolving: [103 0]
after exec 80 4917888 3330160 2639072 1264388 false 722 7 <0>
Putting.
[612.0 792.0]

The problem is that the resulting PDF is not complete.

I'm suspecting that the problem is GlyphNames2Unicode (\001) Tj, is there a way to generate the complete PDF even with this error?

Upvotes: 1

Views: 2069

Answers (1)

KenS
KenS

Reputation: 31199

It sounds like your PDF file is broken, exactly how it's broken isn't clear, at least in part because you haven't included the full back channel transcript and haven't provided the file to look at.

The errors actually begin with the line:

FAPIhook --nostringval--
Font --nostringval-- ( aliased from DAAAAA+LiberationSerif ) is mapped to FAPI=FreeType

--nostringval-- isn't legal there, so something is alredy wrong.

The only way to 'generate the complete PDF file' is for Ghostscript to successfully repair the problem. Clearly it isn't doing so currently, which is either a bug or simply a PDF file broken in a new way that the developers haven't seen previously. Without seeing the file it's not possible to tell.

Probably your best bet is to report this as a bug at bugs.ghostscript.com and attach the PDF file there (along with your command line, which you also haven't given here).

Upvotes: 4

Related Questions