how do you print out two pages

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
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

how do you print out two pages

Post by jalz » Wed May 07, 2014 8:34 pm

Hi Guys,

Working on printing out a card. The height of the card is the equivalent two A4 sheets. My print code below only seems to print 1 page. How do I force it to print the equivalent of the second page?

I've got my print code below, anyone out there to advise me how to get the second page out. Im wondering whether I need to split the second page onto another card and then print all cards, but I want explore doing everything on one card as its easier for me to format.

Code: Select all

on mouseUp
    reset printing
   set the printPaperOrientation to "portrait"
   --A4 dimensions are 595,842 
   --set the printPaperSize to 595,842
   set the printMargins to 13,0,13,0
   --set the printMargins to 72,144,72,144
   set the printGutters to 0,0
   print this card --from 0,30 to 595,842
   close printing
   
end mouseUp
Thanks
Jalz

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: how do you print out two pages

Post by Klaus » Wed May 07, 2014 9:20 pm

Hi Jalz,

check "open printing" in the dictionary!
This will let you print more than one card.

Code: Select all

...
open printing
##open printing with dialog
##open printing with dialog as sheet
repeat with x = 1 to the number of cards
   print card
end repeat
close printing
...
See also "break" (keyword)! :D

Best

Klaus

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: how do you print out two pages

Post by jalz » Wed May 07, 2014 9:24 pm

Hi Klaus,

Thanks as always for your help. Just before I go check, your script implies that I need to recreate 'page 2' on another card, and then loop through the cards using print card. Is that correct?

right off to look at the dictionary again and check….

Jalz

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: how do you print out two pages

Post by Klaus » Wed May 07, 2014 9:28 pm

Hi Jalz,

maybe I misunderstood you?
Do you want to print a card that is large than one "page" on two "pages"?
Or print more than one card?


Best

Klaus

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: how do you print out two pages

Post by jalz » Wed May 07, 2014 9:35 pm

Hi Klaus,

At present I have a card which is approximately 1600pt in height. Based on that I am trying to print this card out, if I try to print it out on A4, I would expect the content of the card should fit comfortably on two pages of A4. I would like to know how I can print the bottom/second page if thats possible.

Hope that makes sense. I've added a simple stack to show you what I mean. I would like to print the whole thing out.

Thanks
Jalz
Attachments
print.livecode.zip
(3.99 KiB) Downloaded 175 times

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: how do you print out two pages

Post by Klaus » Thu May 08, 2014 12:56 pm

Hi Jalz,

"ususally" a big card will be printed automatically on X (whatever) pages are necessary.

A card will be printed "as is", so in your stack you would need to (temporarily) set the height
of your card to the "formatedheigth" of the card, print the card and then reset to initial height.


Best

Klaus

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: how do you print out two pages

Post by jalz » Thu May 08, 2014 1:17 pm

Hi Klaus,

I think I tried that yesterday whilst testing printing my long card. Although two pages were sent to the printer, only the first page had data. I'll double check again when I'm back at home as I tried a combination of things.

The data that is contained in the long card, is data that has come out a datagrid and formatted in a particular way. Do you think it would be better splitting this data into card 1 for page 1, card 2 for page 2, card 3 for page etc.? I just tend to find formatting all the data onto one long card as to splitting it on multiple cards easier.

Jalz

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: how do you print out two pages

Post by Klaus » Thu May 08, 2014 2:45 pm

Hi Jalz,

in your case you maybe should:
1. make the datagrid fit on the (small and completely visible) card
2. OPEN PRINTING -> print the card
3. PRINT BREAK ## force a new page
4. Scroll the next lines of the datagrid into view!
5. print card again
6. - N. repeat 4, 5 and 6 as neccessary
N + 1. CLOSE PRINTING
:D


Best

Klaus

Post Reply