multi-page canvas postscript

12 views
Skip to first unread message

Stephen Kun

unread,
Jan 13, 1999, 3:00:00 AM1/13/99
to
Hi,
I know the canvas won't give me multi-page output for
a canvas, but does anyone know of a standalone utility that
will convert a large, single page postscript output
from Canvas into a multiple page postscript file?

Thanks for any info. Could you mail me directly as
my news reader barely works at the moment

--
-----------------------------------------------------------------------
Stephen Kun Email: steph...@is.gaertner.de
Kurzekampstr. 10 Tel: +49 531 237 13 88 (work)
38104 Braunschweig, Tel: +49 531 37 37 28 (private)
Germany Web Site: http://www.transeda.com

Victor Wagner

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
Stephen Kun <steph...@is.gaertner.de> wrote:
: Hi,

: I know the canvas won't give me multi-page output for
: a canvas, but does anyone know of a standalone utility that
: will convert a large, single page postscript output
: from Canvas into a multiple page postscript file?

You can easily write such beast on Tcl. There are options of
canvas postscript subcommand, which allow to write only part of canvas.

Just decide page size and loop over the canvas writing page in time.

Here is an example that writes one page if canvas fits in A4 or two
pages if not. I didn't need to generalize it more, but you got the idea:


proc print {} {
foreach {dd ss width height} [.w cget -scrollregion] break
set width [expr $width-$dd]
set height [expr $height-$ss]
if {$width>96*7} {
exec lpr << [.w postscript -x $dd -y $ss -width [expr $width/2]\
-height $height]

exec lpr << [.w postscript -x [expr $dd+$width/2] -y $ss \
-width [expr $width/2] -height $height]
} else {
exec lpr << [.w postscript -x $dd -y $ss -width $width\
-height $height]
}
}

--
--------------------------------------------------------
I have tin news and pine mail...
Victor Wagner @ home = vi...@wagner.rinet.ru

Reply all
Reply to author
Forward
0 new messages