[Newbies] Generating printable output files from Squeak

Kevin Polston khwp.01 at googlemail.com
Sun Aug 2 09:16:42 UTC 2009


Hi
I'd like to create a printable output file from within Squeak, for  
instance to create a report.

I've done a little Googling and I'm surprised by how little material  
in the way of examples relating to creating printable files exist.   
However, I've found a couple of classes class called PostscriptCanvas  
and EPSCanvas and a method within it called morphAsPostscript.

To try these classes out I created a tiny code example and my first  
workspace example was:

	p := PasteUpMorph new.
	p extent: 300 at 300.
	p position: 20 at 20.
	p borderColor: Color black.
	p setProperty:  #cornerStyle toValue: #rounded.
	p openInWorld.
	(FileStream newFileNamed: 'test1.ps') nextPutAll: (PostscriptCanvas  
morphAsPostscript: p).

unfortunately the above doesn't work and halts with doesnotUnderstand  
#pageBBox.

when I try the example again but this time using the EPSCanvas class:

	p := PasteUpMorph new.
	p extent: 300 at 300.
	p position: 20 at 20.
	p borderColor: Color black.
	p setProperty:  #cornerStyle toValue: #rounded.
	p openInWorld.
	(FileStream newFileNamed: 'test2.eps') nextPutAll: (EPSCanvas  
morphAsPostscript: p).

this time I generate output but the corners of the box aren't rounded  
in the eps file (they are rounded on the screen).

So, my questions are:
1) Am I on the right track as far as generating printable output or  
should I be using an alternative technique?
2) Why does the first example crash with doesnotUnderstand #pageBBox?
3) Why does the second example *almost* work but does not render the  
rounded corners?

Many thanks
Kevin



More information about the Beginners mailing list