Printing

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
mtecedor
Posts: 68
Joined: Fri Sep 04, 2009 6:40 pm

Printing

Post by mtecedor » Tue Nov 17, 2009 8:06 pm

Hi all,

I have a small (?) problem I ope someone can help me fix.

I am printing a complex layout, so I followed the instructions I found in the user guide. Everything seems to be ok except the margins. I have tried to set them up, but it does not recognize the settings.

This is my code

on mouseUp
open card "GuardarMap" of stack "Guardar" --this is where I have the "header"
hide stack "Guardar"

set the printerOutput to "device"
set the printerName to the first line of the availablePrinters
set the printPaperOrientation to "landscape"
set the printPaperScale to 0.5
set the printMargins to 100,100,100,100 -- I tried several values but nothing works

open printing
set the defaultStack to "Guardar" -- the header
print this card from the topLeft of group "MapHeader" of card "GuardarMap"\
to the bottomRight of group "MapHeader" of card "GuardarMap" into \
the rect of group "MapHeader" of card "GuardarMap"
put the bottom of group "MapHeader" of card "GuardarMap" into tHeaderBottom

set the defaultStack to "Estratego"-- the body
set the printTextAlign to center -- I tried also this, but I am not printing text, so I dont know
print this card from the topLeft of field "Green" of card "BrainMap"\
to the bottomRight of field "Green" of card "BrainMap" into \
0,tHeaderBottom,the right of field "Green" of card "BrainMap", \
the bottom of field "Green" of card "BrainMap" + tHeaderBottom
close printing
end mouseUp

any suggestion will be welcomed

Marta

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Tue Nov 17, 2009 11:08 pm

At first glance, there's nothing wrong with the script, so what is the unexpected behavior? Did you expect the printout to be scaled to fit inside the margins, or be clipped at the margins, or...?

I'm sure we can help you figure it out.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

mtecedor
Posts: 68
Joined: Fri Sep 04, 2009 6:40 pm

Post by mtecedor » Wed Nov 18, 2009 1:31 am

Sorry, it seems I didnt explain myself.
The problem is that its printing over the margins, so part of the header text cannot be seen, and the body is not aligned in the center of the page.

mtecedor
Posts: 68
Joined: Fri Sep 04, 2009 6:40 pm

problem solved

Post by mtecedor » Wed Nov 18, 2009 2:25 am

Just in case anyone is interested. I solved the margins problem. Apparently, the printMargins command does not work for this type of printing.

So, you need to specified the margining in the body of the printing layout.

The example of the user guide sets it up at 0

print the card from the topLeft of field "Green"
to the bottomRight of field "Green" into
72, tHeaderBottom,the right of field "Green",-- the 72 is the left margin
the bottom of field "Green" + tHeaderBottom

I hope it helps to someone

Marta

Post Reply