Printing and previewing

Graham Samuel livfoss at mac.com
Sun Mar 4 15:43:24 EST 2007


On Sat, 3 Mar 2007 13:58:28 -0800, Scott Morrow  
<scott at elementarysoftware.com> wrote:

> Graham,
>     I tackled this task a while back.  Here is an outline of my
> approach:
>
> First, I use a separate "printing stack" for laying out the text,
> adding page numbers, headers etc.  I took the block of text I wanted
> to print (unknown size) and broke it up into page size chunks,
> placing text into a field on the "printing stack" and creating a new
> card in the "printing stack" for each new page-sized chunk of text
> until all the original text had been placed into the "printing
> stack".  Techniques for doing this have been discussed on this list
> more than once.  (I've included a script scrap below which was
> developed from advice offered here.)
>
> Once you have a mechanism for knowing where the page breaks occur,
> this same routine can be used for putting text into a series of
> fields inside a scrolling "preview" group that the user can examine.
> I still use the "printing stack" with format for printing to
> determine each page break and then copy the text off of each card and
> place it into a normally formatted (and visible to the user) stack,
> each card of the "printing stack" going into a separate "page-o-text"
> field. I put a field that displays the page number in between each
> "page-o-text" field.  If this is all in a scrolling group then the
> user can scroll through and see the number of pages and exactly where
> each page break will occur.
> HTH
>
> -Scott Morrow

[snip]

Scott, thanks a lot - I was using a separate "printing stack", but  
the idea of copying back the text which had been formatted for  
printing, so as to know where the page breaks were for the preview,  
had not occurred to me at all. Brilliant! I feel a lot more confident  
about tackling this now.

Thanks again

Graham


----------------------------------------
Graham Samuel / The Living Fossil Co. / UK and France




More information about the use-livecode mailing list