Printing just one card to PDF [was Re: The owner of a selected control - a mystery]

Graham Samuel livfoss at mac.com
Tue Feb 24 06:22:33 EST 2015


Ha - I didn’t pay sufficient attention. In the LC Dictionary for ‘open printing’ it says:

>  Important! Any printing options, such as setting print spacing and margins, must be set before the open printing statement.  Any options which are set after it will be ignored. 

So, mea maxima culpa.

Graham

I just wrote:

> Wow! It worked!  I did not get an extra page, and so I got what I wanted. 
> 
> At first sight, I couldn't see the functional difference between my code and yours., then I realised that you set the printMargins BEFORE your ‘open printing’ statement, and I’d set them afterwards. I suppose to the engine this is somehow logical. I will see if a clarifications needs to go into the LC Dictionary.
> 
> Thanks - wonderful!
> 
> Graham 
> 
> PS This was using LC 7.0.2 rc-2 on a Mac with Yosemite 10.10.2
> 
> 
>> On 24 Feb 2015, at 01:29, Paul Hibbert <paul at livecode.org> wrote:
>> 
>> 
>>> On Feb 23, 2015, at 1:00 AM, Graham Samuel <livfoss at mac.com> wrote:
>>> 
>>> I am trying to understand how to generate a PDF which has exactly the same dimensions as the object which is being ‘printed’
>> 
>> 
>> Try this…
>> 
>>    set the printMargins to 0,0,0,0
>>    set the printPaperSize to the width of this card,the height of this card
>>    open printing to pdf specialFolderPath("Documents") & "/mytest.pdf" -- or Wherever
>>    print this card
>>    close printing
>> 
>> It works for me in LC5.5.5 to LC7.0.2(rc2).
>> 
>> Paul
>> ______________________________________________
> 




More information about the use-livecode mailing list