Problem printing in a standalone application

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Problem printing in a standalone application

Post by mtecedor » Wed Nov 18, 2009 5:34 pm

Hi all,

I have a printing problem when I create my standalone application. Maybe someone can help me find out whats going on.

I need to print several cards, but I want the printing page to look a bit different than what the end users actually see on the screen. So, I created a substack I called "print layot" and then I created a number of cards inside. Everytime the user click the print button, I open a card in the print layout stack, I hide it, and then I copy only the components of the card into a card in print layout stack. Then I have a printing command.

This method works perectly in editing mode, but it doesnt work when I create the standalone application.

This is the code I have in the printing button:

on mouseUp
copy field "Text2" to card "Hilite2" of stack "print layout"
set the htmlText of field "Text2" of card "Hilite2" of stack "print layout" to the htmlText of field "Text2" of this card

open card "GuardarHilite" of stack "Guardar"
hide stack "Guardar"

open card "Hilite2" of stack "print layout"
hide stack "print layout"


set the printerOutput to "device"
--set the printerOutput to "file:/Users/mtecedor/USB DISK/Estratego_Test/Subrayado.pdf"
set the printerName to the first line of the availablePrinters
set the printPaperOrientation to "landscape"
set the printPaperScale to 0.6

open printing
set the defaultStack to "Guardar"
print this card from the topLeft of group "HiliteHeader" of card "GuardarHilite"\
to the bottomRight of group "HiliteHeader" of card "GuardarHilite" into \
the rect of group "HiliteHeader" of card "GuardarHilite"
put the bottom of group "HiliteHeader" of card "GuardarHilite" into tHeaderBottom

set the defaultStack to "print layout"
print this card from the topLeft of field "Pink" of card "Hilite2"\
to the bottomRight of field "Pink" of card "Hilite2" into \
72,tHeaderBottom,the right of field "Pink" of card "Hilite2", \
the bottom of field "Pink" of card "Hilite2" + tHeaderBottom
close printing
end mouseUp

Any idea why this works on editing mode but not on the standalone?

Thanks


Marta

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

Post by Janschenkel » Wed Nov 18, 2009 5:48 pm

Have you tried inserting 'answer' statements or another form of logging to see how far it gets? Also, make sure to add the Error reporting dialog to your standalone - it comes in especially handy during test faze, and it's not bad for a deployed app either.

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

Post Reply