Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Printing to printer - Linux - LPRINT alternative?
#9
(05-27-2023, 02:12 AM)desA Wrote: Does QB64 have a write to text file option?

You could write text into a text file and use the file as candidate for "lp" terminal command or something else.

If you are writing a program that has to create its output as it goes, and it's harder to create one file out of it, then you use SHELL like I told you. First you put into a temporary file the stuff you expect printed. A sequential file for text, or a binary file for image. Then you use SHELL to call "lp" or other program that does the printing, using the temporary file as the input to that program called with SHELL.

You want a code block like:
Code: (Select All)
ff = freefile
open "/tmp/myfileforprint" for output as ff
'call function that create complex thing
f$ = mycomplexfunction
print #ff, f$
close ff
SHELL _HIDE "lp /tmp/myfileforprint"

I'm sorry I didn't look up the whole syntax of "lp" command but you'll get the general idea.

This code could be put into a subprogram and repeatedly called when you need to output something to the printer.

You could look at this but it might not be very helpful:

https://linux.org/threads/printing-image...nux.45232/
Reply


Messages In This Thread
RE: Printing to printer - Linux - LPRINT alternative? - by mnrvovrfc - 05-27-2023, 02:45 AM



Users browsing this thread: 8 Guest(s)