Avoiding line cut-off in a multipage printout

Graham Samuel livfoss at mac.com
Mon Mar 27 11:33:25 EST 2006


Thanks to Ken Ray and Dave Cragg for pointing out the existence 'the  
pageHeights'. I had missed this. Although somewhat eccentric, i.e.

> Comments:
> The value reported by the pageHeights property is a list of numbers  
> separated by returns. Each number is the height in pixels of a page  
> full of text.
>
> You can use the pageHeights property to print the entire contents  
> of a field by printing the field, setting the field's scroll to the  
> first line of the pageHeights, printing the field again, setting  
> the scroll to the current scroll plus line 2 of the pageHeights,  
> and so on.
>
> The computations used by the pageHeights property assume the  
> field's borderWidth property is set to zero and its margins is set  
> to 6.

it does look like the answer. Thanks to you both. There does at first  
sight seem to be one problem, which is that if the last page isn't  
full of text, then AFAIK scrolling won't work, because the scroll  
will include stuff from the previous page... but as I've been wrong  
about everything else I'm probably wrong about this too. Also I'm not  
sure what the implications of the margins being set to 6 are... nor  
if this works when the formatForPrinting is set (I suppose so,  
otherwise what would be the use of it?). I'll experiment.

> On 3/27/06 12:36 AM, "Graham Samuel" <livfoss at mac.com> wrote:
>
>
>> It gets worse! I see now that the script can't know the exact number
>> of lines that will be printed without clipping on a properly
>> formatted page under Windows! What I can't understand (as with other
>> aspects of printing) is why so few developers seem to care about
>> this. Not everybody reads stuff on the screen: for example teachers,
>> I find, want to carry bits of paper away with them (such as student
>> reports) even if the actual app is a highly interactive screen-based
>> thing.


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




More information about the Use-livecode mailing list