[gs-cvs] gs/lib

Igor Melichev igor at ghostscript.com
Tue Jul 19 23:00:56 PDT 2005


Update of /cvs/ghostscript/gs/lib
In directory casper2:/tmp/cvs-serv6733/gs/lib

Modified Files:
	ps2ps2.bat gs_pdfwr.ps 
Added Files:
	ps2ps2 ps2ps2.cmd 
Log Message:
Fix (ps2write) : Bring the script to the traditional form.

DETAILS :

Bug 688190 "ps2write : improve the ps2ps2 script".

Since ps2write actually is a clone of pdfwrite,
we define special distiller settings named PSPrinter.
After this device parameters are gone from the script,
and the ps2ps2 script looks similarly to ps2ps .

EXPECTED DIFFERENCES :

None.


--- NEW FILE: ps2ps2 ---
#!/bin/sh
# $Id: ps2ps2,v 1.1 2005/07/20 06:00:54 igor Exp $
# "Distill" PostScript.

# This definition is changed on install to match the
# executable name set in the makefile
GS_EXECUTABLE=gs

OPTIONS="-dSAFER"
while true
do
	case "$1" in
	-*) OPTIONS="$OPTIONS $1" ;;
	*)  break ;;
	esac
	shift
done

if [ $# -ne 2 ]; then
	echo "Usage: `basename $0` [options] input.ps output.ps" 1>&2
	echo "  e.g. `basename $0` -sPAPERSIZE=a4 input.ps output.ps" 1>&2
	exit 1
fi

exec $GS_EXECUTABLE -q -sDEVICE=ps2write "-sOutputFile=$2" -dNOPAUSE -dBATCH $OPTIONS "$1"

Index: ps2ps2.bat
===================================================================
RCS file: /cvs/ghostscript/gs/lib/ps2ps2.bat,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ps2ps2.bat	7 Jun 2005 18:33:56 -0000	1.1
+++ ps2ps2.bat	20 Jul 2005 06:00:54 -0000	1.2
@@ -1,15 +1,24 @@
- at rem $Id$
+#!/bin/sh
+# $Id$
 @rem Converting Postscript 3 or PDF into PostScript 2.
 
-set invoke0=%GSC% -dBATCH -dNOPAUSE -dNOOUTERSAVE -sDEVICE=ps2write -sOutputFile=%2 %more_param% 
-set invoke1=-c mark /PreserveHalftoneInfo true /TransferFunctionInfo /Preserve 
-set invoke2=/MaxViewerMemorySize 8000000 /CompressPages false /CompressFonts false /ASCII85EncodePages true 
-set invoke3=%more_deviceparam% .dicttomark setpagedevice -f %more_param1%
-set invoke=%invoke0% %invoke1% %invoke2% %invoke3%
+if %1/==/ goto usage
+if %2/==/ goto usage
+call gssetgs.bat
+echo -dNOPAUSE -dSAFER -dBATCH >_.at
+:cp
+if %3/==/ goto doit
+echo %1 >>_.at
+shift
+goto cp
 
-if %jobserver%. == yes. goto s
-%invoke%  %1
-goto j
-:s
-%invoke% -c false 0 startjob pop -f - < %1
-:j
+:doit
+rem Watcom C deletes = signs, so use # instead.
+%GSC% -q -sDEVICE#ps2write -sOutputFile#%2 @_.at %1
+goto end
+
+:usage
+echo "Usage: ps2ps [options] input.ps output.ps"
+echo "  e.g. ps2ps -sPAPERSIZE=a4 input.ps output.ps
+
+:end

--- NEW FILE: ps2ps2.cmd ---
/* $Id: ps2ps2.cmd,v 1.1 2005/07/20 06:00:54 igor Exp $ */
/*
 * This file is maintained by a user: if you have any questions about it,
 * please contact Mark Hale (mark.hale at physics.org).
 */

/* "Distill" PostScript. */

parse arg params

gs='@gsos2'

if params='' then call usage

options='-dNOPAUSE -dBATCH'

/* extract options from command line */
i=1
param=word(params,i)
do while substr(param,1,1)='-'
	options=options param
	i=i+1
	param=word(params,i)
end

infile=param
if infile='' then call usage
outfile=word(params,i+1)
if outfile='' then call usage

gs '-q -sDEVICE=ps2write -sOutputFile='outfile options infile
exit

usage:
say 'Usage: ps2ps ...switches... input.ps output.ps'
exit

Index: gs_pdfwr.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/gs_pdfwr.ps,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- gs_pdfwr.ps	9 Jun 2005 07:29:57 -0000	1.43
+++ gs_pdfwr.ps	20 Jul 2005 06:00:54 -0000	1.44
@@ -232,6 +232,37 @@
   /UCRandBGInfo /Preserve
 .dicttomark readonly
 
+% Define distiller settings for the ps2write device and for the ps2ps2 script :
+/PSPrinter mark
+  /AutoRotatePages /None
+  /CannotEmbedFontPolicy /Error
+  /ColorACSImageDict .prepressACSImageDict
+  /ColorConversionStrategy /LeaveColorUnchanged
+  /ColorImageDownsampleType /Bicubic
+  /ColorImageResolution 600
+  % /CompatibilityLevel 1.2 % Always 1.2 with ps2write.
+  % /CreateJobTicket true % Not sure
+  /DoThumbnails false
+  /EmbedAllFonts true
+  /GrayACSImageDict .prepressACSImageDict
+  /GrayImageDownsampleType /Bicubic
+  /GrayImageResolution 600
+  /MonoImageDownsampleType /Bicubic
+  /MonoImageResolution 1200
+  /NeverEmbed []
+  /PreserveEPSInfo true
+  /PreserveOPIComments true
+  /PreserveOverprintSettings true
+  /UCRandBGInfo /Preserve
+
+  /PreserveHalftoneInfo true 
+  /TransferFunctionInfo /Preserve 
+  /MaxViewerMemorySize 8000000 
+  /CompressPages false 
+  /CompressFonts false 
+  /ASCII85EncodePages true 
+.dicttomark readonly
+
 .dicttomark readonly def
 
 % ---------------- End of predefined configurations ---------------- %
@@ -649,7 +680,11 @@
 1010 % priority
 {
     % Set a predefined configuration in the distiller device (pdfwrite)
-    /PDFSETTINGS where { pop /PDFSETTINGS load } { /default } ifelse
+    /PDFSETTINGS where { 
+      pop /PDFSETTINGS load 
+    } { 
+      currentdevice .devicename /ps2write eq { /PSPrinter } { /default } ifelse
+    } ifelse
     .distillersettings exch get
     % Don't override parameters defined on the command line.
     dup length .distillercommon length add dict begin



More information about the gs-cvs mailing list