0

I have a postscript file when i open it with ghostscript it show output with no error. But when i try to distill it with adobe it stops with following error.

%%[ Error: undefined; OffendingCommand: show; ErrorInfo: MetricsCount --nostringval-- ]%% I have shortened the file by removing text from it now there are only two words in output.

postscript file

Khizer But
  • 11
  • 1
  • Hey Khizer, and welcome to Stack Overflow! Please take a moment and have a look at [this little guide to asking a good question](https://stackoverflow.com/help/how-to-ask) and consider editing your question to include some examples of both the code you're having an issue with and what you've tried to fix it. – Benji Mar 28 '18 at 13:15
  • Hmm, you aren't related to Khizar Shahid are you ? He's working with files from Elixir too..... Clearly the problem is with the embedded CIDFont SimSun. Of the three PostScript interpreters I have to hand only Adobe Distiller complains. So I would guess that Adobe is expecting your CIDFont to have a MetricsCount, and it doesn't. You could try adding one. Other than that, you'll probably have to ask Adobe, I can't immediately see anything wrong with the font, though it would take some time to check it carefully, and since GS works.... :-) – KenS Mar 28 '18 at 16:11
  • But when i send print command to printer it generates error. – Khizer But Mar 28 '18 at 17:30
  • Can we add MetricsCount property in CIDFont manually. And why other interpreters don't ask about MetricsCount. The Main problem occurs when we print the ps document generated by CIDFont. It stops printing with error. but it distills perfectly in ghostscript. – Khizer But Mar 29 '18 at 04:49

1 Answers1

0

The MetricsCount key is documented in Adobe Tech Note 5012 The Type 42 Font Format Specification. According to the specification it can have 3 possible values, 0, 2 or 4.

Section 5.7 on page 22 of the document:

When a key /MetricsCount is found in a CIDFont with CIDFontType 2, it must be an integer with values 0, 2, or 4.

To me this suggests that the MetricsCount key/value pair is optional, and as I said other interpreters don't insist on its presence. I can't possibly tell you why Adobe Distiller appears to insist on it, I don't have any experience of the internals of the Distiller PostScript interpreter. I'd have to guess that all Adobe PostScript interpreters have this 'feature' though, presumably your printer is using an Adobe PostScript interpreter.

Simply adding the MetricsCount key does not work. Why didn't you try this yourself instead of asking me ? It would have been quicker....

The error is subtly different, I suspect the answer is that your CIDFont is missing something (or has something present) which is causing Distiller to look for a MetricsCount. I can't see anything obvious in the PostScript information, so perhaps there's something in the sfnts, though that would be surprising.

Interestingly I have in front of me a PostScript file containing a CIDFont which does not have a MetricsCount entry, and which Distiller processes without a complaint.

I can't let you have the file I'm using, its a customer file. However the fact that such a file exists indicates that other such files must exist. The one I'm looking at was created by QuarkXpress. I'd suggest that you try and find a working file to compare against. I'd also suggest that you try and make a smaller, simpler, CIDFont. One with a single glyph would be favourite I'd think.

KenS
  • 30,202
  • 3
  • 34
  • 51