Bug 687464 - Problem converting from PS to PDF. 2 latin characters did not convert properly.
Summary: Problem converting from PS to PDF. 2 latin characters did not convert properly.
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 8.14
Hardware: PC Windows NT
: P2 critical
Assignee: Igor Melichev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-14 00:27 UTC by KH Subrahmanyan
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer: 130
Word Size: ---


Attachments
Original PS file (44.04 KB, application/postscript)
2004-05-14 00:36 UTC, KH Subrahmanyan
Details
Converted PDF file (4.30 KB, application/pdf)
2004-05-14 00:37 UTC, KH Subrahmanyan
Details
Converted PDF file (4.30 KB, application/pdf)
2004-05-14 00:38 UTC, KH Subrahmanyan
Details
JPG file showing the differences (37.37 KB, image/jpeg)
2004-05-14 02:02 UTC, KH Subrahmanyan
Details
A reduced test (13.97 KB, application/postscript)
2004-05-20 06:32 UTC, Igor Melichev
Details
A PDF created with Adobe 6.0 (9.52 KB, application/pdf)
2004-05-20 07:03 UTC, Igor Melichev
Details
Input PS File (409.99 KB, application/postscript)
2004-05-31 23:32 UTC, KH Subrahmanyan
Details
Output PDF File (87.47 KB, application/pdf)
2004-05-31 23:33 UTC, KH Subrahmanyan
Details
BMP file showing the differences. (2.25 MB, image/bmp)
2004-06-02 02:06 UTC, KH Subrahmanyan
Details
The "Input PS File" converted by Adobe Distiller 6 (241.90 KB, application/pdf)
2004-06-07 12:35 UTC, Igor Melichev
Details
The last PDF with no Encoding (241.90 KB, application/pdf)
2004-06-08 00:12 UTC, Igor Melichev
Details
AdobeFnt07.lst file (3.51 KB, application/postscript)
2004-06-08 19:30 UTC, KH Subrahmanyan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description KH Subrahmanyan 2004-05-14 00:27:38 UTC
Hi,
  We were trying to convert a PS file that was captured from the SAP Spool to 
PDF, using GhostScript. But the 2 latin characters did not convert properly. 

The GhostScript Version we used is 8.14.

Command used to Convert the PS file to PDF is:

gswin32 -q -IC:/hp-dazel/os/lib/FONTS/Soft_Horizons -I../lib -dSAFER -dNOPAUSE -
dBATCH -sOutputFile=file.pdf -sDEVICE=pdfwrite -c .setpdfwrite -f file.ps

I am attaching the original PS file (file.ps), the converted PDF file 
(file.pdf) and the bmp file (ps2pdf_problem.bmp) which shows the difference 
between the 2 files.
The arrows indicate, the characters which are not converted properly.

Thanks
Subrahmanyan.
Comment 1 KH Subrahmanyan 2004-05-14 00:36:26 UTC
Created attachment 662 [details]
Original PS file

Original PS file captured from the SAP spool.
Comment 2 KH Subrahmanyan 2004-05-14 00:37:48 UTC
Created attachment 663 [details]
Converted PDF file

Converted pdf file.
Comment 3 KH Subrahmanyan 2004-05-14 00:38:11 UTC
Created attachment 664 [details]
Converted PDF file

Converted pdf file.
Comment 4 KH Subrahmanyan 2004-05-14 02:02:11 UTC
Created attachment 665 [details]
JPG file showing the differences

JPG File showing the differences
Comment 5 Jack Moffitt 2004-05-18 06:56:11 UTC
Can't reproduce in 8.14 with the GPL fonts.  Will try will Soft Horizon fonts.
Comment 6 Jack Moffitt 2004-05-18 13:57:32 UTC
Reproducable with CVS HEAD but only using Soft Horizon's fonts. Assigning to
Igor for investigation.
Comment 7 Igor Melichev 2004-05-20 06:20:45 UTC
I also noticed a problem with regular GS fonts in the text "ICO/DIC". After the 
distillation with GS the first "C" dissappears.
Comment 8 Igor Melichev 2004-05-20 06:32:48 UTC
Created attachment 674 [details]
A reduced test

It only prints the text "I¨^O". Distilling with GS with regular GS fonts, the
2nd character is lost.
Comment 9 Igor Melichev 2004-05-20 06:48:56 UTC
Both "Converted PDF file" are same.
Comment 10 Igor Melichev 2004-05-20 07:03:53 UTC
Created attachment 675 [details]
A PDF created with Adobe 6.0

Adobe Distiler 6.0 also has problems with the PS file. Particularly it skips
Ccaron. Ghostscript doesn't skip Ccaron and displays its PDF correctly. But
Adobe can't display Ccaron.

I don't see anything wrong in the PDF created by GS. Likely we observe an Adobe
problem.
Comment 11 Igor Melichev 2004-05-20 10:19:34 UTC
Patch
http://www.ghostscript.com/pipermail/gs-cvs/2004-May/004489.html
makes URW fonts and SoftHorizon fonts to give same result.

I still observe a problem with ccaron and Ccaron in Adobe Viewer on Windows.
I believe it is Adobe problem. 

I intend to close this bug. Any objections ?
Comment 12 Igor Melichev 2004-05-20 10:31:38 UTC
Same patch is applicable for to GS_8_1X. Here is exact instance :
http://www.ghostscript.com/pipermail/gs-cvs/2004-May/004490.html
Comment 13 KH Subrahmanyan 2004-05-24 01:54:25 UTC
Hi,
	I tried viewing the converted PDF file with GSView and GS 8.14. I could 
see the problem existing. So it may not be the Adobe problem.

Thanks & Regards,
Subrahmanyan.
Comment 14 Igor Melichev 2004-05-24 02:48:14 UTC
Dear Subrahmanyan,

Did you apply the patch before testing GS ?
The patch is attached to here.

Igor.
Comment 15 KH Subrahmanyan 2004-05-24 04:54:46 UTC
Hi,
  Yes, I applied the Patch, but still it didn't work for me.

Subrahmanyan.
Comment 16 Igor Melichev 2004-05-24 05:34:26 UTC
Please give me a precise information :
1. Convert Original PS with unpatched GS and view it with unpatched GS.
2. Convert Original PS with patched GS and view it with patched GS.
Do they give same raster ? I believe they should be different. Please attach 
both rasters.



Comment 17 KH Subrahmanyan 2004-05-25 04:22:56 UTC
Dear Igor,
	Sorry for the late response.
Yes, I tried both the cases. And I could see the differences.
When I converted the PS file with patched GS and view it with the Patched GS, I 
could see the document correctly.
But with Adobe Acrobat, it is not showing properly. So should we need to 
contact Adobe for this problem?

Thanks & Regards
Subrahmanyan.
Comment 18 Igor Melichev 2004-05-25 04:42:17 UTC
Yes, I think so. If you use Windows, the problwem may also happen in Adobe to 
Microsoft interfaces, I mean the emulation of PS fonts with Microsoft fonts.

Here is my summary :
The mentioned patch fixes the problem in pdfwrite.
The patched revision creates a correct PDF.
That PDF views correctly in Ghostscript with URW fonts.
Meanwhile there still exist 2 problems, which to be reported to 3d parties :
1. The characters ccaron, Ccaron doesn't view in Adobe Reader on Windows.
Please report to Adobe.
2. The characters ccaron, Ccaron doesn't view in GS with Soft Horizon fonts.
Ghostscript prints "Substituting .notdef for Ccaron." because the glyph is 
missed in the font. Please report to Soft Horizon.


Comment 19 KH Subrahmanyan 2004-05-31 23:30:23 UTC
Hi,
 We have a similar problem.
Here pdf file converted from PS using GS 8.13 or GS 8.14, is not displayed 
properly in Adobe Acrobat 6.0. It is observed that the output PDF file has one 
unknown character at the starting of each line.

I am attaching the input PS file and output PDF file. 
Can you please go through this and find out, if it is a GS problem or Acrobat 
problem.

Thanks
Subrahmanyan.
Comment 20 KH Subrahmanyan 2004-05-31 23:32:02 UTC
Created attachment 692 [details]
Input PS File

This is original PS File.
Comment 21 KH Subrahmanyan 2004-05-31 23:33:18 UTC
Created attachment 693 [details]
Output PDF File

This is the Output PDF File, which has an unknown extra character at the
begining of each line.
Comment 22 Igor Melichev 2004-06-02 00:56:56 UTC
Can't reproduce.
The attached "Output PDF file" views fine on Windows XP with Acrobat reader 5, 
Adobe Acrobat 6 Professional, and with Adobe reader 6. Converting the "Input PS 
file" with gs 7.14 and CVS HEAD got a document, which also viewes fine. Please 
explain more detailedly, what problem do you observe.

Restoring the bug status to the previous state.
Comment 23 Igor Melichev 2004-06-02 01:31:46 UTC
Oops, I've meant gs8.14.
Comment 24 KH Subrahmanyan 2004-06-02 02:06:33 UTC
Created attachment 695 [details]
BMP file showing the differences.

BMP File showing the differences in PS File and the PDF file. 
One unknown character is seen in the begining of each line, which is marked
with read arrow in the BMP file. That character looks like small sqaure with 2
diagonal lines.
I tried viewing the PDF file in Win XP also, with Acrobat 6.0. There also I
could see the unknown characters.
Comment 25 Igor Melichev 2004-06-07 12:32:05 UTC
I do not observe the boxes you show in the "BMP file showing the differences".
The PDF file contains the charater 0x20 in that positions, and does not embed 
the related font, which is Courier with no Encoding. The viewer must paint 
space character. In your case likely it paints .notdef . This definitely is a 
problem of the viewer.

I guess this is a problem of a Windows NT localization, which could be 
contributed either by Microsoft for a specific locale or a specific localized 
version of Windows, or by Adobe with a localized Acrobat Reader, or by a 3d 
party IME software or by a 3d party font software. 
Comment 26 Igor Melichev 2004-06-07 12:35:31 UTC
Created attachment 707 [details]
The "Input PS File" converted by Adobe Distiller 6

I've converted you "Input PS File" with Adobe Distiller 6 on my system and
unpacked streams in there with the pdfinflt.ps tool. Do you observe boxes with
it ?
Comment 27 KH Subrahmanyan 2004-06-07 20:22:28 UTC
No, I don't see any extra characters in the file which you created using Adobe 
Distiller 6. This file is perfectly fine.
Comment 28 Igor Melichev 2004-06-08 00:12:27 UTC
Created attachment 709 [details]
The last PDF with no Encoding

I've edited the Adobe's PDF with removing Encoding entries. This makes it
closer to the Ghostscript output. Please check whether your viewer shows boxes
with it.
Comment 29 Igor Melichev 2004-06-08 00:16:32 UTC
As I know, you could reproduce the problem with Windows XP. Please give me more 
information about that system : 
- the version number;
- A service pack version number;
- The PDF viewer version;
- What locales are installed ?
- Which installed 3d party products could contrubute/modify fonts ?
Comment 30 Igor Melichev 2004-06-08 00:20:54 UTC
When you see boxes in Adobe Reader, please open File/DocumentProperties/Fonts 
and copy the table to here.
Comment 31 KH Subrahmanyan 2004-06-08 05:38:34 UTC
I don't see the boxes, with the attached PDF file, which you edited by removing 
Encoding entries.
Comment 32 KH Subrahmanyan 2004-06-08 05:50:45 UTC
This is what I saw in the "File->DocumentProperties->Fonts" Dialog, when I see 
boxes in Adobe Reader.
-------------------------------------
Courier
	Type: Type 1
	Encoding: Standard
	Actual Font: CourierStd
	Actual Font Type: Type 1
Times-Italic
	Type: Type 1
	Encoding: Standard
	Actual Font: TimesNewRomanPS-ItalicMT
	Actual Font Type: True Type
Helvetica-BoldOblique
	Type Type 1
	Encoding: Standard
	Actual Font: Arial-BoldItaicMT
	Actual Font Type: TrueType
Courier-Bold
	Type: Type 1
	Encoding: Standard
	Actual Font: CourierStd-Bold
	Actual Font Type: Type 1
Times-Bold
	Type: Type 1
	Encoding: Standard
	Actual Font: TimesNewRomanPS-BoldMT
	Actual Font Type: True Type
Courier-Oblique
	Type: Type 1
	Encoding: Standard
	Actual Font: CourierStd-Oblique
	Actual Font Type: Type 1
Times-BoldItalic
	Type: Type 1
	Encoding: Standard
	Actual Font: TimesNewRomanPS-BoldItalicMT
	Actual Font Type: TrueType
Courier-BoldOblique
	Type: Type 1
	Encoding: Standard
	Actual Font: CourierStd-BoldOblique
	Actual Font Type: Type 1
Helvetica
	Type: Type 1
	Encoding: Standard
	Actual Font: ArialMT
	Actual Font Type: TrueType
Helvetica-Bold
	Type: Type 1
	Encoding: Standard
	Actual Font: Arial-BoldMT
	Actual Font Type: TrueType
Times-Roman
	Type: Type 1
	Encoding: Standard
	Actual Font: TimesNewRomanPSMT
	Actual Font Type: TrueType
Helvetica-Oblique
	Type: Type 1
	Encoding: Custom
	Actual Font: Arial-ItalicMT
	Actual Font Type: TrueType
-------------------------------------
Comment 33 Igor Melichev 2004-06-08 10:40:32 UTC
Regarding to the Comment #32 :
On my system all fonts are substituted with Type 1 fonts.
This is a difference with the user's system, which uses some True Types.

Please attach your file 
"*:\Program Files\Adobe\Acrobat 6.0\Resource\Font\AdobeFnt*.lst"
or its analogue. Thank you.
Comment 34 KH Subrahmanyan 2004-06-08 19:30:33 UTC
Created attachment 714 [details]
AdobeFnt07.lst file

This is the file, which you asked me to attach, in comment #33.
Comment 35 Igor Melichev 2004-06-10 00:13:33 UTC
The problem described in the Comment #19 is moved to the bug 687510.
Please write all further related issues to there, 
because this bug was initially opened for another problem.
Comment 36 Igor Melichev 2005-08-18 10:37:41 UTC
Created attachment 1638 [details]
cust.ps

Attaching a test file receieved from the customer. It almost same as receieved
before, but we need to keep the file name for references.

When cust.ps is converted with Adobe Distiller
and then the generated PDF is viewed with Adobe Reader,
the 2 characters disappear. Therefore I conclude that
the problem lies in Adobe Reader.
Likely they missed the character Ccaron from their font Helvetica-Bold.

Ghostscript 8.00 can't convert that text due to another minor problem,
and therefore it replaces the font Helvetica-Bold with
a bitmap font, which is synthesized while the conversion.
For doing that, Ghostscript uses an URW font NymbusSanL-Bold,
which does include Ccaron. Therefore you can see it in cast-good.pdf .

Thus what you need is to use the URW font instead the Adobe font
either in the conversion, or while viewing the result.
I guess you prefer the fist.

As a workaround I suggest to apply distiller parameters :

<<   /NeverEmbed [false /Helvetica-Bold] >> setdistillerparams

I've tried it and got a good result - see attachment.

As a next step, maybe you'll need it to be done automatically.
I mean that you may want Ghostscript to recognize missed glyphs
and apply /NeverEmbed [false ...] automatically.
Unfortunately I have no idea how to make Ghostscript to know
which glyphs Adobe missed. Therefore I can't suggest an automatic method.
Comment 37 Igor Melichev 2005-08-18 10:40:36 UTC
Created attachment 1639 [details]
cur.pdf

A PDF generated by Ghostscript from cust.ps using <<   /NeverEmbed [false
/Helvetica-Bold] >> setdistillerparams .