🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1467

Insert date/page# in text object's PS output?

#1467
From: Gordie Freedman
Date: Wed, 14 Oct 1992 06:02
48 lines
2555 bytes
I would like to know how to count the pages that will be printed
by a text object's print method (the method that uses the print panel
and creates a postscript representation of the text contents). I also
want to insert the title (filename - directory) at the top of each
page and the date/page# at the bottom. I'm not sure how to figure out
the size of the pages, and where I would insert this stuff to get it in the
right place after it is printed.

Another question I have is how to stop the print method from vertically
centering the text in a page when there is less than one page of text.

Here's more background:

I have subclassed a text object and am using it to "pretty print" code.
One nice feature of this is that I can use the standard print panel to
actually print (or stuff in a file) postscript code for the text buffer.
I format the text using bold for the reserved words and italics for the
comments (similar to vgrind for any Unix hacks).

What I want to do is put "filename - directory" at the top of each page, and
the date and page number at the bottom. I expect I can do this by creating
a new instance of a text object, copying the contents of the original
text buffer into it, format the bold/italics, and stick in the title,
date and page number. Then I can print the new text object and free it
when I am done. 

My questions are:

1) How do I determine the size of a page so that I can stick the title
on top, track the # of pages and stick the date and page number on the
bottom?

2) Is there an easier way to do what I described?

3) How do I set the top and bottom border for each page? (Related to #1)

4) How do I prevent the print method from vertically centering text
when there is less than one page?

Thanks in advance for any answers or pointers to docs to read.

(Anybody ever notice the ever popular bundle acronym rtfd also has another
meaning in Unix slang?)


---
Gordie Freedman: gordie@kaleida.com Sigs are for kids
Technical Details
Message-ID: <73366@apple.Apple.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!att-out!rutgers!ub!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!taligent!apple!moon!gordie

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!att-out!rutgers!ub!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!taligent!apple!moon!gordie
From: gordie@duts.ccc.amdahl.com (Gordie Freedman)
Newsgroups: comp.sys.next.programmer
Subject: Insert date/page# in text object's PS output?
Keywords: Postscript Text View Print
Message-ID: <73366@apple.Apple.COM>
Date: 14 Oct 92 06:02:58 GMT
Sender: daemon@Apple.COM
Reply-To: gordie@duts.ccc.amdahl.com
Organization: Happy hacker bait and tackle shop
Lines: 48