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

Getting postscript output seperated into pages.

20 views
Skip to first unread message

Neil Madden

unread,
Dec 3, 2001, 12:58:56 PM12/3/01
to
I have created a script which reads an XML file and formats it in a
canvas, and then extracts postscript to a new file. When I run "distill"
on this and look at thr resulting PDF file, however, the whole thing is
in one giant page, instead of broken up into A4 pages. Anyone know how I
divide this up into pages. Code:

# Read XML file and process into canvas
...
# Now create the postscript:
set data [.c postscript -colormode gray \
-x 0 -y 0 -width 21c -height $nextline \
-pageheight 29.7c -pagewidth 21c]

These parameters are based on me measuring an A4 sheet of paper with a
ruler, so not hugely accurate!
$nextline holds the canvas coordinate of the next place to insert a text
item (which will be the bottom of the canvas when this command gets
called). Everything else is fine with the PDF, it just doesn't split
into pages.

Any ideas?

Neil.

Devin Eyre

unread,
Dec 4, 2001, 6:14:06 AM12/4/01
to
Have you looked at the postscript before converting it to PDF?
Also, the canvas postscript command outputs Encapsulated PostScript
(EPS). You may want to use the postscript command once for each page,
and stitch them together with some regular Postscript.
deyresprint1.vcf

Neil Madden

unread,
Dec 4, 2001, 11:44:41 AM12/4/01
to

OK. I'm new to all this. I was kind of hoping from the -pageheight
-pagewidth options that Tk could automatically do the pagination, but
clearly not. Time to start reading up a bit more in-depth on postscript
I guess...

Robert Heller

unread,
Dec 4, 2001, 12:51:31 PM12/4/01
to
Neil Madden <nem...@cs.nott.ac.uk>,
In a message on Tue, 04 Dec 2001 16:44:41 +0000, wrote :

NM> Devin Eyre wrote:
NM> >
NM> > Neil Madden wrote:
NM> > >
NM> > > I have created a script which reads an XML file and formats it in a
NM> > > canvas, and then extracts postscript to a new file. When I run "distill"
NM> > > on this and look at thr resulting PDF file, however, the whole thing is
NM> > > in one giant page, instead of broken up into A4 pages. Anyone know how I
NM> > > divide this up into pages. Code:
NM> > >
NM> > > # Read XML file and process into canvas
NM> > > ...
NM> > > # Now create the postscript:
NM> > > set data [.c postscript -colormode gray \
NM> > > -x 0 -y 0 -width 21c -height $nextline \
NM> > > -pageheight 29.7c -pagewidth 21c]
NM> > >
NM> > > These parameters are based on me measuring an A4 sheet of paper with a
NM> > > ruler, so not hugely accurate!
NM> > > $nextline holds the canvas coordinate of the next place to insert a text
NM> > > item (which will be the bottom of the canvas when this command gets
NM> > > called). Everything else is fine with the PDF, it just doesn't split
NM> > > into pages.
NM> > >
NM> > > Any ideas?
NM> > >
NM> > > Neil.
NM> > Have you looked at the postscript before converting it to PDF?
NM> > Also, the canvas postscript command outputs Encapsulated PostScript
NM> > (EPS). You may want to use the postscript command once for each page,
NM> > and stitch them together with some regular Postscript.
NM>
NM> OK. I'm new to all this. I was kind of hoping from the -pageheight
NM> -pagewidth options that Tk could automatically do the pagination, but
NM> clearly not. Time to start reading up a bit more in-depth on postscript
NM> I guess...
NM>

For a clue on how this can be down, have a look at
http://vis-www.cs.umass.edu/~heller/Workshop/Bridge/Bridge.tcl.gz --
this Tcl/Tk script includes a print function to print out a full sized
version of a large H0 scale bridge from a canvas, which takes several
8.5x11 pages.

Basiclly it is a matter of looping over paper-sized segments of the
canvas, getting the postscript to a variable (rather than sending to the
file directly. Some editing is done and some 'glue' postscript included
to make a multiple page output file.



--
\/
Robert Heller ||InterNet: hel...@cs.umass.edu
http://vis-www.cs.umass.edu/~heller || hel...@deepsoft.com
http://www.deepsoft.com /\FidoNet: 1:321/153

Kevin Kenny

unread,
Dec 4, 2001, 5:52:17 PM12/4/01
to

Neil Madden wrote:
[asking about how to paginate PostScript output from a canvas]

Check out http://purl.org/thecliff/tcl/wiki/949.html and see if that
answers your questions.

--
73 de ke9tv/2, Kevin KENNY GE Corporate R&D, Niskayuna, New York, USA

Neil Madden

unread,
Dec 4, 2001, 7:42:25 PM12/4/01
to
Yes I've seen this already. It produces multiple pages in multiple
files. What I want is multiple pages in the same file. I think the
example Robert Heller posted will help me do this.

Cheers.

0 new messages