Bug 692535 - PS to PCL transformation fails with "Error: invalidaccess; OffendingCommand: put"
Summary: PS to PCL transformation fails with "Error: invalidaccess; OffendingCommand: ...
Status: NOTIFIED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PS Interpreter (show other bugs)
Version: 8.71
Hardware: All All
: P1 critical
Assignee: Marcos H. Woehrmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-23 11:03 UTC by Debashis Sahoo
Modified: 2011-10-05 19:26 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debashis Sahoo 2011-09-23 11:03:23 UTC
Hello,

This is Debashis from Hewlett Packard.

One of our customer is facing one problem where PS to PCL transformation fails with "Error: invalidaccess; OffendingCommand: put" when UNICODE fonts are passed as an argument to Ghostscript command. And the same document is printing fine when the UNICODE fonts are not passed.

Commands:

1. Observed issue with the below command

/home/syed/install/os41/bin/gs  -sDEVICE=pcl5 -I/home/syed/install/os41/lib/FONTS/Unicode -I/home/syed/install/os41/lib/FONTS/Soft_Horizons -I/home/syed/install/os41/lib/PS -sGenericResourceDir=/home/syed/install/os41/lib/Resource/ -q -I.:/home/syed/install/os41/lib/Resource/Init -dBATCH -dNOPAUSE -dSAFER  -dNOGC -dSHORTERRORS -dWRITESYSTEMDICT -dGHOSTSCRIPT -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792  -sOutputFile=/home/debashis/testOut.pcl gs_nostd.ps -c "<< /IdiomRecognition false >> setuserparams" - < input_file.ps

~~~~~~~~~~~~~~~~~~~~~~ERROR~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%%[ Error: invalidaccess; OffendingCommand: putArtifex Ghostscript 8.71: Unrecoverable error, exit code 1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2. Problem not seen with the below command

/home/syed/install/os41/bin/gs  -sDEVICE=pcl5 -I/home/syed/install/os41/lib/FONTS/Soft_Horizons -I/home/syed/install/os41/lib/PS -sGenericResourceDir=/home/syed/install/os41/lib/Resource/ -q -I.:/home/syed/install/os41/lib/Resource/Init -dBATCH -dNOPAUSE -dSAFER  -dNOGC -dSHORTERRORS -dWRITESYSTEMDICT -dGHOSTSCRIPT -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792  -sOutputFile=/home/debashis/testOut.pcl gs_nostd.ps -c "<< /IdiomRecognition false >> setuserparams" - < input_file.ps

Uploaded FONTS.tar and input_file.ps in the below ftp location:


    FTP System:       ftp.usa.hp.com  (15.192.32.78)
    Login:            artgs871
    Password:         Artgs87!  (NOTE: CASE-sensitive)


    FTP Access:       ftp://artgs871:Artgs87!@ftp.usa.hp.com/
            or:       ftp://artgs871:Artgs87!@15.192.32.78/
    HTTPS Access:     https://ftp.usa.hp.com/hprc

Thanks,
Debashis
Comment 1 Alex Cherepanov 2011-09-24 20:42:27 UTC
This is not a Ghostscript bug.

The problem is caused by an assumption made by the sample PS program
that findfont always returns a global font when the current allocation
mode is global. This is not the case when TrueType fonts are loaded by
Ghostscript.

The program should be modified as 
/pa_ReEncode {
  pa_reencsmalldict begin    
  /glob currentglobal def  % remember the global flag
  % ...
  /basefontdict basefontname findfont 
  dup gcheck setglobal  % set the matching global mode
  def
  % ...
  glob setglobal % restore the global flag
  end
} def

The user can also upgrade to v. 9.00 and higher.
New versions load TrueType fonts differently, and the font matches the
assumption. However, it is still possible to construct a font
(e.g. Type 3) that will fail the sample PS file.
Comment 2 Debashis Sahoo 2011-09-26 06:14:01 UTC
Hi Alex,

This issue observed when -I/home/syed/install/os41/lib/FONTS/Unicode
passed to the GS but when we passed -I/home/syed/install/os41/lib/FONTS/Soft_Horizons this issue never observed.

The suggestion provoded by you, upgrade to the version higher or equal to 9.0, is not possible now because of other constraints. So, a solution with respect to the GS version 8.71 will be greatly appreciated.

Thanks,
Debashis
Comment 3 Debashis Sahoo 2011-09-27 07:15:18 UTC
Hi,

Could you please update us about the resolution for this issue?
Please let us know if anything from our end need to updated.

Thanks,
Debashis
Comment 4 Marcos H. Woehrmann 2011-09-27 16:30:39 UTC
It is not possible for us to backport the change that fixed the issue between 8.71 and 9.00, the change to a different font renderer was extensive.

Since we have determined that the PostScript file is making incorrect assumptions about how TrueType fonts are loaded into memory and have provided a suggested fix I don't believe there is anything else we can do.
Comment 5 Debashis Sahoo 2011-10-05 04:54:43 UTC
Hi Macro,

Could you please let us know exact version or, latest version of GS so that we can test? Also it will be good if we got all the bug/issue details of your recommended version of GS.

Thanks,
Debashis
Comment 6 Marcos H. Woehrmann 2011-10-05 19:26:21 UTC
The latest version of Ghostscripts is 9.04; I've sent you an email with the download instructions.  Documentation included with the release gives updates on what changes have been made and which bugs have been fixed.  

If you have further questions please email me directly.