ghostscript

why is ghostscript replacing embedded fonts?


well I've given up. I don't think I understand how GS works... as far as I understand GS replaces all fonts that are not embedded and should not touch already embedded ones? why is it replacing them? I have a pdf file that contains 2 embedded fonts and 1 not embedded (ArialMT).

I'm using command:

"gswin64c.exe -I "C:/Program Files/gs/gs9.56.1/Resource/Init" -sFONTMAP="Fontmap.GS" -dNOSAFER -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=LeaveColorUnchanged -dBATCH -dNOPAUSE -sDEVICE="pdfwrite" -dAutoRotatePages=/None -dPDFA=3 -sOutputFile="pdfa.pdf" "original.pdf" 

all I get with this command is this error:

GPL Ghostscript 9.56.1: Actual TT subtable offset xxxxx differs from one in the TT header yyyy. (multiple ones like this)

The following errors were encountered at least once while processing this file:
        error executing PDF token

   **** This file had errors that were repaired or ignored.
   **** The file was produced by:
   **** >>>> StreamServe Communication Server 16.6.1 GA Build 319 (64 bit) <<<<
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

the output is a pdf without ANY fonts...

  1. is there any way to force GS not to replace font if it wasn't found on the system?
  2. why is it replacing ArialMT with NimbusSans-Regular even though I have declared a specific path to ArialMT in my FontMap.GS file?

I'd rather not share this pdf file as it contains sensitive customer data.

enter image description here

(osadzony podzestaw=embedded subset)


Solution

  • Ghost Script substitution will require embeddable fonts on windows those are usually stored in C:\Windows\Fonts

    NOTE this is a question about an old version GPL Ghostscript 9.56.1 these commands would NOT be advised for much newer Version 10.x

    Thus if font substitution was simple (without look-up) your command could be simplified

    gswin64c.exe -sFONTPATH="C:\Windows\Fonts" -dNOSAFER -sDEVICE=pdfwrite -dNEWPDF=false -dPDFA=3 -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=LeaveColorUnchanged   -dAutoRotatePages=/None  -o"pdfa.pdf" "original.pdf"
    

    you need to add -dNEWPDF=false Since to include additional mapping you add -I "C:/Program Files/gs/gs9.56.1/Resource/Init" -sFONTMAP=Fontmap.gs

    Thus the following should be a startpoint

    gswin64c.exe -sFONTPATH="C:\Windows\Fonts" -I "C:/Program Files/gs/gs9.56.1/Resource/Init" -sFONTMAP=Fontmap.gs -dNOSAFER -sDEVICE=pdfwrite -dNEWPDF=false -dPDFA=3 -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=LeaveColorUnchanged   -dAutoRotatePages=/None  -o"pdfa.pdf" "original.pdf"
    

    It will not remove warnings using a PDF file from the same developer, the difference was now there is no mention of Nimbus, but the substitutions should be better/fuller as the warning messages verified the fonts were eventually applied from windows

    enter image description here

    Note the file is smaller although the fonts are embedded, and in side by side comparison they look the same.

    GPL Ghostscript 9.56.1: PDFA doesn't allow images with Interpolate true.  
    
    and  
    
    The following errors were encountered at least once while processing this file:
            missing white space after number
            error executing PDF token
    
       **** This file had errors that were repaired or ignored.
       **** Please notify the author of the software that produced this
       **** file that it does not conform to Adobe's published PDF
       **** specification.
    

    from their report.

    If I save the file from Acrobat the file size drops but the same issues reside