Printing examples?

graham samuel graham.samuel at wanadoo.fr
Fri Apr 1 04:29:46 EST 2005


Thanks to all who replied: I'm getting good advice on this. Chipp, 
thanks for your example of print with preview: I was doing something a 
bit like this, but your solution is better thought out, I gladly admit. 
On one point I don't quite concur. You wrote:

> Call the PageSetup function (answer printer) and from this you get the
> printPaperSize (tPageHeight and tPageWidth). You can use these to setup
> your offscreen imaging stack. You also get the printMargins as well. 
> Use
> these also to setup your offscreen print stack.

Actually AFAICS the user can't reset the printMargins - they just stay 
stubbornly at 72 points all round (one inch) - at least this is what 
happens here on my OSX setup: in fact I can't display an OS-originated 
dialog which straightforwardly allows the user to reset the margins, it 
has to be done by a kind of trick. I think it might be easier on the PC 
- there the problem is different, in that I can't get the 'Print' 
dialog to appear at all. I just don't know how you can tell the PC to 
print more than one copy, for example. Still trying.

Sarah wrote:
>> 1. I arranged for the initialisation routine in my app to read the
>> paper size and the margins and to make my stack the same size as the
>> printPaperSize and my print area the same size as the page minus the
>> margins.
> Make the card the same size as the print area i.e. the printPaperSize
> less the printMargins.
> Have your printable objects fill the card so there is no excess space
> left at the margins of the card.

Ah! Light dawns! The RunRev card doesn't represent a page, as I had 
thought: it represents something that fills the printable area on the 
page, which can be completely different. I was using the wrong mental 
model. this means that the printMargins will not tell you where to put 
your printing on the card, although ironically they will tell you how 
wide the printable area is allowed to be.

Sarah also wrote:
> I don't know how Rev handles you setting the margins in Page Setup..
> but you can easily set them in your script:
> set the printMargins to "50,50,50,50"

Well, I want my user to be able to set the margins, as in other apps: 
in particular, I want the user to be able to select the largest 
available printable area on the page, which is certainly going to be 
greater than is implied by the default margins of 72,72,72,72, but will 
in most printers be more than 0,0,0,0 (true, there are some printers 
that do edge-to-edge printing, but this is unusual). So I would like to 
be able to detect what these limits are. Otherwise if my app, or my 
user, blindly sets the printMargins to some arbitrary value, some of 
the printing may be cut off - this of course depends on the particular 
printer being used, which in general the app can't know in advance. See 
Bug 1619.

Thanks for all the advice

Graham

----------------------------------------
Graham Samuel / The Living Fossil Co. / UK and France




More information about the use-livecode mailing list