Printing multiple pages

J. Landman Gay jacque at hyperactivesw.com
Fri Jan 16 12:58:49 EST 2009


Sarah Reichelt wrote:
> Hi All,
> 
> I have a script that splits a report into multiple pages and tries to
> print them one by one. I have a single field that displays the data,
> then I have tried various ways to get the pages to print. I want to
> queue all the pages and have them all print at once.
> 
> My basic script is:
> 
>     repeat with x = 1 to tPageCount
>         displayPage x
>         print this card
>         --   revPrintField the long name of fld "Report"
>         --  revPrintText the htmltext of fld "Report", , ,the long
> name of fld "Report"
>     end repeat
> 
> As you can see, I have tried using revPrintField and revPrintText but
> had to settle on "print this card".
> revPrintField and revPrintText both worked the first time, but after
> that, they only printed the last page.
> "print this card" seems to work every time, but I have to resize the
> stack while printing, and it seems slower.

Did you wrap the printing commands in "open printing" and "close 
printing" commands? That controls whether the job is sent to the printer 
all at once or not.

I'm not sure why it isn't working, but the way I usually do it is to 
move the field contents to an invisible printing substack. The substack 
is set up to contain only the elements that should print; if all you 
want is the field contents, then your print stack would be a single card 
with a single field on it. Size the stack and field correctly for the 
paper and just save it into the main stack that way. This has the 
advantage that you can also set the field's text properties however you 
want, even if they are different from the original field's properties. 
When you want to print, move the field contents to the field in the 
print stack. Then open printing, displayPage x, print the card, repeat. 
When done, close printing.

This has always worked fine for me. RevPrintField is indeed supposed to 
manage pagination, so I'm not quite sure what's happening with that. 
Wonder if the script got changed lately.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list