Centering an image for printing

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Scott Richardson
Posts: 34
Joined: Mon May 08, 2006 7:02 pm

Centering an image for printing

Post by Scott Richardson » Fri Nov 14, 2008 9:45 pm

I have a stack from which I need to print portions of a card and for that image to be centered on a US letter sized page. I have already figured out how to set the margins, etc. as well as how to print only the portions of the card that need to print. Since from some cards the images are smaller and "portrait" and on others the images are larger and "landscape," I would like for them to all just print centered on the page to make it easier for the end user. My coding skills are minimal, but what I have so far works except for the centering part. Is there an efficient way to accomplish this? Here is what works for me so far:

answer Page Setup
answer printer
set the printMargins to 36,36,36,36
print this card from the topleft of grp "printGroup" to the bottomRight of grp "printGroup"

Of course, this requires that in Page setup the user must choose the paper size and if it is landscape or portrait. This may not be the best way, either. Any help and/or suggestions are appreciated.

Scott

Post Reply