Printing Help?

J. Landman Gay jacque at hyperactivesw.com
Tue Jun 30 13:32:54 EDT 2009


Scott Rossi wrote:

> Fairly simple: one card, 8x10 (to fit easily on 8-1/2 x 11), user doesn't
> need to see it on screen.  I a simple "print this card" on Mac running Rev 3
> and it seemed to work fine.  Tried it on another machine running Rev 3.5,
> and I get split second of progress bar, and then nothing: no printing
> starts, Printer app doesn't open, the result is empty.

The "print card" command should just work, it's the most basic printing 
function. One thing to try is to get the printernames and see if the 
printer you are using is in there; if not, Rev doesn't see it. Second 
thing to try is:

  open printing with dialog
  if the result = "cancel" then exit to top -- or cleanup, whatever
  print card "myTemplate"
  close printing

Sometimes forcing the print dialog can kick start things. I also prefer 
it because it gives the user more control, and it lets me check for a 
cancellation. But you don't have to keep it for your final version if 
you don't want it, just use it for now to see if it helps.

Since the result is empty, I'm wondering if the script is aborting for 
some reason. Can you tell if it is actually finishing, or is it just 
hanging? Printing is hard to debug because once the system print job 
starts, the OS takes over and you can't cancel in order to get back to 
Rev. I've had to force-quit these things more times than I like to 
remember. Before debugging any print job, *always* save your stack. As 
soon as you set a debug breakpoint, you may have to force-quit if there 
is an error.

Another (probably safer) way to debug it would be to put logging info 
into the message box or a field. See if you ever actually get to the end 
of the handler.

Also, when it hangs, manually open the print job queue in your printer 
app or the OS and see what it's doing. Sometimes that will give a clue 
what the error is.

> 
> Does a stack need to be visible to print?  If not, I guess I need to open it
> off screen? 

No, invisible stacks print fine. It's actually the standard way to do 
printing with templates.

> 
> I'm also not clear on the Page Setup behavior.  Is the idea to store the
> result as printerSettings and apply the saved data in the future so the user
> doesn't need to set up the printer again?

Yes. But you don't need to mess with it except under specific 
circumstances. When you call page setup, Rev will store the settings and 
use them automatically. The only time you'd want to store those and use 
them later is if you know for a fact that a printer is available (like, 
on a local network,) and you want to make sure you print to that 
specific printer without having to tell the user to reset their printer 
manually. For what you are doing, just showing page setup and forgetting 
about it is fine; Rev will handle the details for you.

> 
> Jacque, you're always willing to step in and provide help, it's just
> amazing.  Thank you so much.

You're welcome, but it isn't trouble and I really feel we need to pay 
ahead on this list. We're all in this together. I've hit you up for 
advice in the past too. ;)

And anyway, I'm still not sure what's wrong or if I helped...

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



More information about the use-livecode mailing list