Printing multiple pages

Sarah Reichelt sarah.reichelt at gmail.com
Sun Jan 18 17:49:40 EST 2009


>> 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.

Yes, I did. Forgot to include that section of my script.


> 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.

I guess I'll have to try something like that. I was hoping to have a
sort of controller stack which gave a live preview of the printout
with all the controls available there on the same stack. Since
revPrintField & revPrintText are not working for me, I have to resize
the card in order to shrink it to the print area only, so printing
doesn't look as slick.


> 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.

Pagination is not a problem, but I want to do it myself so I can add
page numbers & titles to each page.

Cheers,
Sarah



More information about the use-livecode mailing list