Problem with formatForPrinting not working

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
friccio
Posts: 2
Joined: Wed Feb 19, 2020 4:19 pm

Problem with formatForPrinting not working

Post by friccio » Wed Feb 19, 2020 4:30 pm

Hello All,

I'm new to LiveCode, started using it a couple of weeks ago, I made an app that prints tickets using a thermal printer and all was working perfect while working on my Mac, but when I used it in a windows computer I noticed that all the fields printed different, I found that formatForPrinting should be set to true in order for the stack to use the fonts that windows will use when printing, but so far nothing I tried with it has made any difference. As a temporary solution I am printing to a PDF and the executing a shell command to print that PDF, but I would like to be able to do it the right way. Has anybody used formatForPrinting successfully?. Can you tell me or show me the right way to do it? Any help will be very much appreciated.

Thanks

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problem with formatForPrinting not working

Post by jacque » Thu Feb 20, 2020 6:53 pm

Welcome to LiveCode! Can you describe how the printout differs on Windows? Also, post the relevant portion of the printing handler.

If the only issue is incorrect line wraps it is probably because Windows fonts have different widths than Mac fonts. You can fix that by changing the font size (or the font itself) when printing on a Windows machine. Your script can find out what OS is running by checking "the platform".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Problem with formatForPrinting not working

Post by SparkOut » Thu Feb 20, 2020 9:39 pm

I don't often print from LiveCode but when I do it is on Windows and setting a "print stack" to have formatForPrinting as true, it "works". This setting also applies when printing to pdf so I am not sure whst is "wrong" with how you are trying to print. As jacque says, could you provide some sample code?

Post Reply

Return to “Windows”