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@300. p position: 20@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@300. p position: 20@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
Hi Kevin,
there is a Seaside FAQ on generating PDFs
http://seaside.st/documentation/pdfs
HTH
Matthias
On Sun, Aug 2, 2009 at 11:16 AM, Kevin Polstonkhwp.01@googlemail.com wrote:
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@300. p position: 20@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@300. p position: 20@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:
- 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
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
beginners@lists.squeakfoundation.org