Bug 691386 - Fonts changed from TrueType to CID TrueType and not displaying correctly in output PDF
Summary: Fonts changed from TrueType to CID TrueType and not displaying correctly in o...
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 8.70
Hardware: Sun SunOS
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 18:07 UTC by George Norris
Modified: 2010-10-05 13:15 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Norris 2010-06-11 18:07:43 UTC
Created attachment 6367 [details]
gzipped tar file containing 3 files described in the description

Files in gzipped tar file:
=========================
Please keep attachments private

00047_npi.ps 
  Input PostScript File

00047_npi_pdfa.pdf 
  PDFA file created from 00047_npi.ps (Has issue)

00047_npi_non_pdfa.pdf
  non-PDFA file created from 00047_npi.ps (Does not have issue)

Bug Description:
===============

When we use gs (8.70) to convert a PostScript file to a PDFA file, in some cases, it is changing the fonts from TrueType fonts to CID TrueType fonts.  
The PDFA file is viewable, but the fonts are not displaying correctly.

If we use gs (8.70) to convert the same PostScript file to a non-pdfa file, the
problem does not occur and the PDF file is viewable with all fonts displaying
correctly.

Note that the 00047_npi.ps was created from a file named 00047.pdf file using the XPDF tool pdftops.  Then the 00047_npi.ps was then manually edited to X or 0 out confidential text that the 00047_npi.ps file contained.  We would request that the files still remain private.  Since we cannot edit the 00047.pdf file to remove the personal information, it is not attached.

We understand that the Ghostscript staff is not responsible for issues with
XPDF tools.  However, we do not think that the XPDF tool is the issue here.
This is evident given that there is not an issue when converting 00047_npi.ps
to a NON-PDFA output file.

Here are the fonts in the original PDF:
======================================

pdffonts 00047.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
AAAAAA+Times-New-Roman-Bold          TrueType          yes yes yes      9  0
AAAAAB+Times-New-Roman               TrueType          yes yes yes     10  0
IDHBRX+TimesNewRoman,Bold            TrueType          yes yes yes     37  0
 
Here is some info on the original PDF:
=====================================

pdfinfo 00047.pdf
Creator:        Crystal Reports
Producer:       www.adlibsoftware.com:EXS3183-Windows 2003:TNG
CreationDate:   Wed Oct 14 16:14:12 2009
ModDate:        Wed Oct 14 16:14:12 2009
Tagged:         no
Form:           none
Pages:          2
Encrypted:      no
Page size:      612 x 792 pts (letter)
File size:      153896 bytes
Optimized:      no
PDF version:    1.3
 
Here are the fonts in the 00047_npi.ps file:
===========================================

grep 'BeginResource: font' 00047_npi.ps
%%BeginResource: font AAAAAA+Times-New-Roman-Bold
%%BeginResource: font AAAAAB+Times-New-Roman
%%BeginResource: font IDHBRX+TimesNewRoman,Bold

Here is what we found when we converted the file to PDFA:
========================================================

Here is the gs command used to convert 00047_npi.ps to a PDFA file:
------------------------------------------------------------------

gs _P- -dPDFA -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -dProcessColorModel=/DeviceCMYK -sDEVICE=pdfwrite -sOutputFile=00047_npi_pdfa.pdf /BSG/data/Fonts/fonts/PDFA/PDFA_def.ps 00047_npi.ps -c save pop
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
 
Here are the fonts in the 00047_npi_pdfa.pdf file: 
-------------------------------------------------

pdffonts 00047_npi_pdfa.pdf
name                                         type                emb sub uni object ID
------------------------------------         -----------------   --- --- --- ---------
DZCGWG+Times-New-Roman-OneByteIdentityH      CID TrueType        yes yes no      13  0
TLXSIP+TimesNewRoman,Bold-OneByteIdentityH   CID TrueType        yes yes yes     18  0
GURFVL+Times-New-Roman-Bold-OneByteIdentityH CID TrueType        yes yes no      11  0
 
Here is some information on the 00047_npi_pdfa.pdf file: 
-------------------------------------------------------

pdfinfo 00047_npi_pdfa.pdf
Title:          Title
Producer:       GPL Ghostscript 8.70
CreationDate:   Fri Jun 11 13:22:10 2010
ModDate:        Fri Jun 11 13:22:10 2010
Tagged:         no
Form:           none
Pages:          2
Encrypted:      no
Page size:      612 x 792 pts (letter)
File size:      125657 bytes
Optimized:      no
PDF version:    1.4
 
Here is what we found when we converted the file to non-PDFA:
============================================================

Here is the gs command used to convert 00047_npi.ps to a NON-PDFA file:
----------------------------------------------------------------------

gs -P- -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=00047_npi_non_pdfa.pdf 00047_npi.ps -c save pop
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
 
Here are the fonts in the 00047_npi_non_pdfa.pdf file: 
-----------------------------------------------------

pdffonts 00047_npi_non_pdfa.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
BMFMHB+TimesNewRoman,Bold            TrueType          yes yes no      13  0
SWNHHA+Times-New-Roman-Bold          TrueType          yes yes no       8  0
LZKZUS+Times-New-Roman               TrueType          yes yes no      10  0
 
Here is some information on the 00047_npi_non_pdfa.pdf file: 
-----------------------------------------------------------

pdfinfo 00047_npi_non_pdfa.pdf
Creator:        Crystal Reports
Producer:       GPL Ghostscript 8.70
CreationDate:   Fri Jun 11 13:22:11 2010
ModDate:        Fri Jun 11 13:22:11 2010
Tagged:         no
Form:           none
Pages:          2
Encrypted:      no
Page size:      612 x 792 pts (letter)
File size:      120063 bytes
Optimized:      no
PDF version:    1.4

Tried using gs with ps2write 
============================
 
gs -P- -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=00047_psw.ps 00047.pdf -c save pop
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 2.
Page 1
   **** Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
   **** Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
   **** Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
   **** Warning: Encoding derived from 'post' is incomplete.
Page 2
   **** Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.
   **** Warning: Embedded symbolic TT fonts must contain a cmap for Platform=1 Encoding=0.

   **** This file had errors that were repaired or ignored.
   **** The file was produced by: 
   **** >>>> www.adlibsoftware.com:EXS3183-Windows 2003:TNG <<<<
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

The 00047_psw.ps file displayed correctly in gs.  We were not able to manually 
X and 0 out the personal information in the 00047_psw.ps file, so I could not 
attach it.  The same issues occurred when we did similiar PostScript to PDF conversions for both the PDFA and non_PDFA versions

We recognize that we could upgrade to 8.71 and the problem "might" go away.
However, we would rather not have to do this at this time.  Please let us know 
if there is something else we can do to resolve this issue.  We would be 
grateful for any assistance or advise that you can provide.

Thank you,

George Norris
BAE Systems
703-563-8483 (office)
301-471-7468 (cell)
george.norris@baesystems.com
Comment 2 Ken Sharp 2010-06-12 10:02:32 UTC
(In reply to comment #0)

> Bug Description:
> ===============
> 
> When we use gs (8.70) to convert a PostScript file to a PDFA file, in some
> cases, it is changing the fonts from TrueType fonts to CID TrueType fonts.  
> The PDFA file is viewable, but the fonts are not displaying correctly.

The conversion to CIDFont is required, because the embedded TrueType fonts are symbolic and most TrueType font contains multiple CMAP subtables.

The PDF/A specification insists that non-symbolic TrueType fonts shall have either a WinAnsiEncoding or MacRomanEncoding, which isn't possible with these fonts, and that symbolic fonts shall have exactly one CMAP.

So we convert all TrueType fonts into CIDFonts for the purposes of PDF/A compliance.

NB Adobe Acrobat Distiller exhibits the same behaviour with this PostScript file, in terms of converting the fonts into CIDFonts.

The fonts do not appear to be correctly embedded, which is unusual, and may be due to the conversion to PostScript. Notice that ps2write issues warnings relating to CMAP subtables and that an Encoding is incomplete, when processing the original PDF file.

Considerable further investigation will be required to discover exactly what the issues are here. However, you might try converting to PDF/A directly from the original PDF, rather than first converting to PostScript, the results might be better.
Comment 3 Ken Sharp 2010-10-05 13:15:04 UTC
This has been fixed by (I believe) revision 11742. Certainly the supplied file works with the current revision of Ghostscript using the supplied command line.

Tested on Windows and Linux as I don't have a SunOS installation to test on.