Unable to Print on Linux Mint

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

DaveI
Posts: 8
Joined: Sat Mar 14, 2020 9:55 pm

Unable to Print on Linux Mint

Post by DaveI » Sat Mar 14, 2020 10:27 pm

Hi, I wrote an application for personal use after I bought a copy of Runtime Revolution a long time ago. Since then I've migrated to the Live Code community version and have been running it on Windows 7 and then 10, it has been great. Decided recently that I would like to move away from Windows and have dual booted my main PC and installed Linux Mint and Livecode and my application. It all works great except .... I can't print anything. Mint sees the printer ok and I can print from documents in the file system and web pages.

If I use the print option in my app, I'm shown the Mint printer selection window (the same as in windows) and I can select my printer. But when I click on Print, it closes the window but nothing prints. I've checked the print job status and nothing appears to be sent to the printer. If I select "print to file" then the print info is sent to the output file and looks perfect. I can then print this from the Mint document viewer.

The same thing happens if I select the "Print Card" option from the File Menu in Live Code. It works if I select "print to file" but not if I try and send it to my printer.

I have now obtained another PC and for use specifically for Linux Mint. Have installed Live Code and my app, I'm using a Brother Laser printer on this machine and I get exactly the same results. The printer works perfectly if I print a file in the OS but will not print anything from within Live Code.

It's almost as if the printer selection details from the Printer Selection window are not getting back to LiveCode. Can anybody help ?

LiveCode Community Edition vers 9 5 1 Build 15505 - Linux Mint 19 point 3

Thanks - Dave

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Unable to Print on Linux Mint

Post by FourthWorld » Sat Mar 14, 2020 10:48 pm

I print (well, to PDF anyway) almost daily from LC 9.x on Ubuntu 18.04. Mint's close enough to Ubuntu I'm surprised you're having a printing issue.

Can you print to PDF? That may help us narrow down what's going on.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

DaveI
Posts: 8
Joined: Sat Mar 14, 2020 9:55 pm

Re: Unable to Print on Linux Mint

Post by DaveI » Sun Mar 15, 2020 1:13 am

Hi thanks for replying. Yes I can print to pdf, that's what the "print to file" option does. I can then print the pdf file outside of LC. On the windows version it works perfectly, and has for many years.
Dave

DaveI
Posts: 8
Joined: Sat Mar 14, 2020 9:55 pm

Re: Unable to Print on Linux Mint

Post by DaveI » Sun Mar 15, 2020 2:52 pm

I've got a little further with this. I've created a new card with a field and a button. The script for the button is :-

on Mouseup
answer printer -- Show printer selection window
answer printerName
answer printerOutput
open printing
print this card
close printing
end Mouseup

When I click on the button this shows me the Linux Mint Printer Selection window and when I select my printer, shows me the correct printer name in printerName and "device" in printerOutput. That is what I would expect based on section 9 of the manual I have. But still doesn't print. When I select "Print to File" I get "print to file" in printerName and the path to the output pdf file in printerOutput and I get a pdf of the card in the output file. So it all appears to be correct. Lots of head scratching going on here :-) pdf output works printing to device doesn't.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Unable to Print on Linux Mint

Post by bogs » Sun Mar 15, 2020 3:01 pm

Hi Davel,

Which desktop manager are you using? MATE? XFCE? Cinnamon?
Image

DaveI
Posts: 8
Joined: Sat Mar 14, 2020 9:55 pm

Re: Unable to Print on Linux Mint

Post by DaveI » Sun Mar 15, 2020 4:10 pm

Hi, I'm using Cinnamon, which seems to be the default.

I've been plugging away at this some more. It seems that once you have printed something to a file the printerOutput property stays as "print to file" no matter how many times you select a printer.

I've just tried setting the sysetmPrintSelector to false and that now brings up the LiveCode printer selector dialog rather than the Mint version but it still doesn't print from there.

I'll have to stop for today as I have some other things I need to do.

Do you think if I changed versions of LiveCode I might have more success. The Windows version is 7 from memory.

Thanks for looking at this for me. -- Dave

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Unable to Print on Linux Mint

Post by bogs » Sun Mar 15, 2020 4:15 pm

Well, first I'm going to try to duplicate your setup as close as I can, and see what happens. If I can reproduce it, I'll regress through Lc versions till I find one that works properly, or, alternately, let you know if I can't reproduce the problem.
Image

DaveI
Posts: 8
Joined: Sat Mar 14, 2020 9:55 pm

Re: Unable to Print on Linux Mint

Post by DaveI » Sun Mar 15, 2020 4:48 pm

OK Bogs,

I have just downloaded 7 1 which is what I'm using on the Windows PC. It does print but it's a bit garbage and it's the same garbage when I print to pdf. The messages on the desktop indicate that it's not printing directly to the printer but to a printtempfile, which is then sent to the printer. I don't see this progress message on Windows so I never knew it used a temporary file until I tried it on Linux.

I've just tried printing from the card that with the script above and it prints to the printer but only the first character of the field. That's what's happening on the other card I tried. just the first character of each line.

Thanks - Dave

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Unable to Print on Linux Mint

Post by mwieder » Sun Mar 15, 2020 5:50 pm

Sorry folks - the LC linux printer driver in the engine is for pdf only, so printing to a pdf file will work. Presumably printing to a postscript printer will work, although I don't have one of those. The older builds (I tried this with 7.1 just to make sure I was remembering correctly) will print postscript to a non-postscript printer. Dave, that's probably the single-character you saw.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Unable to Print on Linux Mint

Post by bogs » Sun Mar 15, 2020 6:11 pm

If that is the case Mark (and I believe you!!), wouldn't a work around be to use lp from the cli by issuing a shell from Lc?

Just as an example, Davel, you said it prints to .pdf no issue, so you print out the pdf then from Lc issue -

Code: Select all

shell("lp ~/fileName.pdf") -- lp is lower case LP --
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Unable to Print on Linux Mint

Post by mwieder » Sun Mar 15, 2020 6:29 pm

Yep - you could also just print to pdf and manually print the pdf. Depends on your specific needs.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Unable to Print on Linux Mint

Post by bogs » Sun Mar 15, 2020 6:43 pm

Hm... I threw in the shell thinking he could print it to pdf, as a temp or stopgap, then print the pdf, then delete the pdf and it would be similar to print actually working heh heh.

I wonder, though, seems to me you could just export a snap shot of the card, and shell lp that just as easily then delete it. Oh well, that is the best I could come up with, Davel. Hope it helps.
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Unable to Print on Linux Mint

Post by mwieder » Sun Mar 15, 2020 6:48 pm

Depends on what you want to do. A screen snapshot won't work if you're trying to print a script from the editor, for example.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Unable to Print on Linux Mint

Post by bogs » Sun Mar 15, 2020 7:18 pm

That is true, for most general purposes, printing it to the pdf first seems the most likely way to go.

Or, alternately, if you are printing out fields, you could save the fields to text and issue the lp for the text files heh.

The second idea hit me slowly, I sure wish my brain would stop Rip Van Winklin on me :P
Image

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1209
Joined: Thu Apr 11, 2013 11:27 am

Re: Unable to Print on Linux Mint

Post by LCMark » Sun Mar 15, 2020 8:13 pm

From memory the linux engine prints using lp (internally via a shell command) after sifting our the relevant parameters from the system dialog... So my guess would be that the lp command is failing - perhaps try checking the result after close printing and see if it reports anything?

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”