Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Canvas Postscript Output - Multiple canvases per page?

11 views
Skip to first unread message

Peter Campbell

unread,
Jul 29, 2001, 9:07:30 PM7/29/01
to
Is there any way to create postscript output containing multiple canvases?

eg:

.canvas1 postscript ...
.canvas2 postscript ...
.canvas3 postscript ...

How could all 3 canvases be printed on the same page in different locations?
Are there better alternatives for printing multiple canvases on one printed
page?

I can use the -pagex/-pagey options in the canvas postscript command but I
cannot see a way to exclude the page start/end commands in the postscript.


Devin Eyre

unread,
Jul 30, 2001, 10:52:43 AM7/30/01
to
Peter Campbell wrote:

>Is there any way to create postscript output containing multiple canvases?
>
>eg:
>
>.canvas1 postscript ...
>.canvas2 postscript ...
>.canvas3 postscript ...
>
>How could all 3 canvases be printed on the same page in different locations?
>Are there better alternatives for printing multiple canvases on one printed
>page?
>

Yes. The canvas postscript command writes encapsulated postscript,
which can be inserted into a regular postscript page, and scaled or
rotated if necessary.

>
>I can use the -pagex/-pagey options in the canvas postscript command but I
>cannot see a way to exclude the page start/end commands in the postscript.
>

Here's part of what I use. To start off the page, you'll have to put
something like this in:

set f [open $filename w]
puts $f "%!PS-Adobe-3.0"
puts $f "%%Pages: 1"
puts $f "%%EndComments"
puts $f "gsave"

proc IncludeEps {file out x y xratio yratio xtrans ytrans} {
#file is eps file to include
#out is an open writable filehandle
#x is the xposition on the page for the lower left corner of the eps
file to go
#y is the yposition on the page for the lower left corner of the eps
file to go
#xratio is the x scaling factor
#yratio is the y scaling factor
#xtrans and ytrans are for the translation sometimes needed after scaling

puts $out {save
/showpage {} def
/erasepage {} def
/copypage {} def
/letter {} def
/legal {} def
/a4 {} def
0 setgray
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[] 0 setdash
/languagelevel where {
pop
languagelevel 2 ge {
false setoverprint
false setstrokeadjust
} if
} if
newpath
}
puts $out "$x $y translate"
puts $out "$xratio $yratio scale"
if {$xtrans != 0 || $ytrans != 0} {
puts $out "[expr -1 * $xtrans] [expr -1 * $ytrans] translate"
}
set f [open $file r]
puts $out [read $f]
close $f
puts $out "restore"
}
#c1-3 would be filenames of the eps files you want to include.

IncludeEps $c1 $f 0 400 1 1 0 0
IncludeEps $c2 $f 0 200 1 1 0 0
IncludeEps $c3 $f 0 0 1 1 0 0

puts $f "grestore"
puts $f "showpage"
close $f

--
de...@univ-wea.com

0 new messages