Print to a Epson Receipt Printer

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
marcnau
Posts: 3
Joined: Sat Jan 27, 2018 7:57 am

Print to a Epson Receipt Printer

Post by marcnau » Sat Jan 27, 2018 8:06 am

Hi, i am new to Livecode, i managed to set up a Database an some other stuff. Now i am stuck. i like to Print via iPad, a Field on a Receipt Printer witch is connected to a Router and the Router to my Network. Is it possible to do this just by code or do i need an other app on my iPad. I can print already stuff out off the Epson Utility app, just not from my own app.
Thank you

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Print to a Epson Receipt Printer

Post by MaxV » Mon Jan 29, 2018 5:29 pm

See: http://lessons.livecode.com/s/lessons/m ... rl-schemes

You should create a PDF to print and send it to print:/path/to/pdf_file.pdf
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

marcnau
Posts: 3
Joined: Sat Jan 27, 2018 7:57 am

Re: Print to a Epson Receipt Printer

Post by marcnau » Tue Jan 30, 2018 8:24 pm

hi Max
Thank you for your Help. I got it working out of livecode on my mac but not on the Ipad.

on printCards
put specialFolderPath("documents") & "/UserGuide.pdf" into tPDFPath

open printing to pdf tPDFPath
if the result is "Cancel" then
## The user has cancelled printing
exit printCards
else
## Print the card into the printable area
print card 1 of this stack into 0,0,100,150
end if
close printing
end printCards

This prints some code, not the document i like to print, on the computer, not on the ipad.
I dont get how the link you posted helps with my problem can you explain?

Thank you very much

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Print to a Epson Receipt Printer

Post by MaxV » Wed Jan 31, 2018 2:03 am

On mobile apps are isolated, they can't talk each other as normal programs on a Mac.
So the epson print app is on a island
Your livecode app is no another island
iOS hasn't a way to print
You have to send a message in a bootle to the app to print. A way is to send it use an url scheme.
Mobile device have avery complex (and stupid) structure.
Another way si to create a PDF, save it on specialFolderPath("documents") and then open the epson app to print it.
Read here: http://livecode.wikia.com/wiki/IOS_filesystem
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

marcnau
Posts: 3
Joined: Sat Jan 27, 2018 7:57 am

Re: Print to a Epson Receipt Printer

Post by marcnau » Thu Feb 01, 2018 7:20 am

aa now i guess i get it. I will try thank you

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Print to a Epson Receipt Printer

Post by MaxV » Thu Feb 01, 2018 4:16 pm

another solution is this:

Code: Select all

 on mouseUp
  put specialFolderPath("Documents") & slash & "test.pdf" into tPDFFile
  delete file tPDFFile
  open printing to pdf tPDFFile
  print this card
  close printing
  rreHardcopyPrintPDF tPDFFile, "Test PDF Print"
  answer "PrintPDF returned" && the result
end mouseUp
See also: https://www.youtube.com/watch?v=XTdLNBN3XUw

and http://livecode.wikia.com/wiki/RreHardcopyPrintPDF
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”