Saturday, December 17, 2005

Ghostscript and Java

I recently experienced problem printing from my java app using ghostscript. The error message is here:
 D [17/Dec/2005:14:25:48 +0700] [Job 54] Error: /configurationerror in --setpagedevice-- D [17/Dec/2005:14:25:48 +0700] [Job 54] Additional information: [/ManualFeed false]  
After hours searching, I finally found the solution.
It is in /usr/share/ghostscript/8.15/lib/gs_setpd.ps
Here is the diff
 --- gs_setpd.ps.bak     2005-12-17 14:30:23.000000000 +0700 +++ gs_setpd.ps 2005-12-17 14:31:49.000000000 +0700 @@ -171,10 +171,10 @@    % the default policy to "7" (impose) to avoid numerous problems with    % printing within CUPS...    % -  % /PolicyNotFound 1 -  % /PageSize 0 -  /PolicyNotFound 7 -  /PageSize 7 +  /PolicyNotFound 1 +  /PageSize 0 +  % /PolicyNotFound 7 +  % /PageSize 7    /PolicyReport {      dup /.LockSafetyParams known {         % Only possible error is invalidaccess