[BUG][FIX]

Richard Staehli rastaehli at mac.com
Thu Aug 14 06:29:02 UTC 2003


Morph method print PSToFileNamed: appends '.eps' even if user 
preference "postscriptStoredAsEPS" is false.  This leads PostScript 
novices like myself to think that eps is being generated, and to 
experience great frustration when the postscript does not behave as it 
should.  A simple fix is as follows:  (but should DCSPostscriptCanvas 
output be given a '.ps' extension?)

printPSToFileNamed: aString
	"Ask the user for a filename and print this morph as postscript."

	| fileName rotateFlag fileExtension |
	Preferences postscriptStoredAsEPS ifTrue: [fileExtension _ '.eps'] 
ifFalse: [fileExtension _ '.ps'].
	fileName _ aString asFileName.
	fileName _ FillInTheBlank
		request: 'File name? ("',fileExtension,'" will be added to end)'
		initialAnswer: fileName.
	fileName size == 0 ifTrue: [^ self beep].
	(fileName endsWith: fileExtension) ifFalse: [fileName _ 
fileName,fileExtension].

	rotateFlag _ ((PopUpMenu labels:
'portrait (tall)
landscape (wide)')
			startUpWithCaption: 'Choose orientation...') = 2.

	(FileStream newFileNamed: fileName)
		nextPutAll: (
			PostscriptCanvas defaultCanvasType morphAsPostscript: self rotated: 
rotateFlag
		); close.



More information about the Squeak-dev mailing list