Printing puzzle

J. Landman Gay jacque at hyperactivesw.com
Wed Jun 19 00:01:48 EDT 2013


On 6/18/13 8:05 PM, David Epstein wrote:
> The question:  how can I find out, by script, how big the unprintable
> margins are when the Page Setup dialog has been set to some scale other
> than 100%?
>
> At 100%, there's no problem.  For example, the unprintable right margin
> = item 2 of the printPaperSize - item 4 of the printRectangle.
>
> But at any other scale I can't use this calculation, because while the
> "printRectangle" responds to a Page Setup choice of scale, the
> "printPaperSize" does not.
>
> Thus if I set the scale to 50%, the printRectangle of 36,36,1188,1504
> tells me the pixels I can fit into a letter size page after shrinking
> them by half and avoiding the unprintable margins.  This means the left
> unprintable margin on the printed output will be 18/72 of an inch
> (shrinking the 36 by 50%).  But I do not see any way of learning this
> information in a script, because the 50% scaling factor is not being
> reported, and the printPaperSize doesn't change the way the
> printRectangle does when the scale changes.  (The "printScale" seems to
> return 1 regardless of what I do to the Page Setup dialog).
>
> What I'm trying to do is show on the screen is both a rectangle that
> will, when printed, be 1 inch from each edge of the paper; and also as
> much space outside of that rectangle as can be printed to.  Thus I need
> to know how much of that 1 inch cannot be printed to.

I'm not sure I follow all that, but I'll toss out a couple of things. 
The printPaperSize won't change unless the user changes the paper feed 
setting in the print setup (or a script changes it) -- it's the physical 
size of the paper. If they change from letterhead to envelope, the 
printPaperSize will change, otherwise it won't.

Every printer has a hard, physical limitation on how far from the edges 
it will print. If you get a half-inch unprintable margin at 100% scale, 
it will still be the same at any other scale. The print head won't 
travel any closer to the edge than half an inch.

The printRectangle represents the largest available printing area for 
the paper that's currently loaded, and takes the unprintable area into 
account. The scale of the printout doesn't change that available area, 
though it will be filled with more or fewer pixels depending on the 
print scale.

I'm not sure if you're trying to print outside the available print 
region (you can't), or if you're trying to scale your card to fit it.

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




More information about the use-livecode mailing list