Printing multiple pages
Sarah Reichelt
sarah.reichelt at gmail.com
Sun Jan 18 22:50:25 EST 2009
>> OK, found my mistake. I had assumed that "open printing" would queue
>> up any print jobs until "close printing". However it only works for
>> printing cards, not for for revPrintText or revPrintField. It would be
>> good if it did, but since I now realise that it doesn't, I'll work out
>> a different method.
>
> Geez, I should have remembered this when you first asked. Both of the Rev
> commands manage the whole print queue themselves, and both contain "open
> printing" and "close printing" commands. I suppose two "open printing"
> commands wouldn't hurt, but Rev's "close printing" will trigger before yours
> does. If your script is only sending one page to it at a time, that's all
> that gets printed.
No, it was my fault for not including the "open printing" & "close
printing" statements in my original quoted script.
> I know it's more work up front, but I recommend the separate printing stack
> approach, especially since you want to implement a print preview. I just
> finished writing one of those. Having a separate stack made it easier
> because I didn't have to worry about the initial stack size; the printing
> stack was already laid out to accomodate the right paper size. For a print
> preview, I ran my printing script normally, but added a parameter to my
> printing handler that indicated whether this was going to a preview or a
> printer. If printer, the script implemented "open printing", etc. If
> preview, it put a snapshot of the loaded page into a variable and sent it
> back to the calling handler.
I'll consider this, but at the moment, I cam happy with using
revPrintText.Once I realised what it was doing, I set up a separate
printing field and header & footers and it's working well. I still use
my layout card to set up the print parameters and to act as a preview.
One factor that is turning me away from using a print stack is the
slowness of "print this card". In some rough tests, I found it to take
about 140 ticks per card where revPrintText & revPrintField were
taking 13 - 14 ticks. Once you have more than a couple pages to print,
this speed difference would become significant.
Cheers,
Sarah
More information about the use-livecode
mailing list