1. Printing from euphoria on OSX box

Hey...

Back to try Euphoria for the second time... ;)

Working my way through the examples in:

"A Beginner's Guide to Euphoria"

The line:

file_id = open("LPT1","w")

in one of the examples, produces NO JOY...

LPT1 seems too Microsoft-centric. What are the equivalents for Linux, FreeBSD and OSX. I've searched the available docs with no luck. TIA.. dukester

new topic     » topic index » view message » categorize

2. Re: Printing from euphoria on OSX box

dukester said...

Hey...

Back to try Euphoria for the second time... ;)

Working my way through the examples in:

"A Beginner's Guide to Euphoria"

The line:

file_id = open("LPT1","w")

in one of the examples, produces NO JOY...

LPT1 seems too Microsoft-centric. What are the equivalents for Linux, FreeBSD and OSX. I've searched the available docs with no luck. TIA.. dukester

For Linux and FreeBSD, you can replace "LPT1" with "/dev/lp" or "/dev/lp0" if you are using an old parallel port printer.

If you are using USB, it is tricker. You need to have a good understanding of the OS's device node naming conventions (devfs on FreeBSD and probably udev on Linux) to figure it out.

It is probably easier to print on Linux and FreeBSD by writing to a temporary file (e.g. "/tmp/temp.txt") and then running lpr (e.g. system("lpr /tmp/temp.txt", 2) ) than trying to open and write to the printer directly.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Printing from euphoria on OSX box

jimcbrown said...
dukester said...

Hey...

Back to try Euphoria for the second time... ;)

Working my way through the examples in:

"A Beginner's Guide to Euphoria"

The line:

file_id = open("LPT1","w")

in one of the examples, produces NO JOY...

LPT1 seems too Microsoft-centric. What are the equivalents for Linux, FreeBSD and OSX. I've searched the available docs with no luck. TIA.. dukester

For Linux and FreeBSD, you can replace "LPT1" with "/dev/lp" or "/dev/lp0" if you are using an old parallel port printer.

If you are using USB, it is tricker. You need to have a good understanding of the OS's device node naming conventions (devfs on FreeBSD and probably udev on Linux) to figure it out.

It is probably easier to print on Linux and FreeBSD by writing to a temporary file (e.g. "/tmp/temp.txt") and then running lpr (e.g. system("lpr /tmp/temp.txt", 2) ) than trying to open and write to the printer directly.

Thanks for the quick reply!

I'm using USB on an OSX Leopard box at the moment. I'll give "/dev/lp" or "/dev/lp0" a try, just for hellery. However, like you suggest, printing the file from the CLI might me way easier.

Be-that-as-it-may, IMHO, this is an issue that should be resolved at the developer(s) level ASAP.

Thanks again... dukester

new topic     » goto parent     » topic index » view message » categorize

4. Re: Printing from euphoria on OSX box

jimcbrown said...
dukester said...

Hey...

Back to try Euphoria for the second time... ;)

Working my way through the examples in:

"A Beginner's Guide to Euphoria"

The line:

file_id = open("LPT1","w")

in one of the examples, produces NO JOY...

LPT1 seems too Microsoft-centric. What are the equivalents for Linux, FreeBSD and OSX. I've searched the available docs with no luck. TIA.. dukester

For Linux and FreeBSD, you can replace "LPT1" with "/dev/lp" or "/dev/lp0" if you are using an old parallel port printer.

If you are using USB, it is tricker. You need to have a good understanding of the OS's device node naming conventions (devfs on FreeBSD and probably udev on Linux) to figure it out.

It is probably easier to print on Linux and FreeBSD by writing to a temporary file (e.g. "/tmp/temp.txt") and then running lpr (e.g. system("lpr /tmp/temp.txt", 2) ) than trying to open and write to the printer directly.

Hi

I use enscript to format and print text files. ie

1. write out a temp text file. 2. enscript [options] text_file 3. delete the temp text file

enscript will print to the default printer using CUPS, but first converts a text file to an intermediate postscript file, but makes it a lot easier to do other stuff, like add borders, page numbers, orientation etc.

http://www.codento.com/people/mtr/genscript/enscript.man.html

If you want to print graphics then use the netpbm utilities to convert various types to output to a printer. I use this to convert and output fax images to a ps file for printing on a windows machine.

http://netpbm.sourceforge.net/

ppmdarw and ppmlabel would seem to have tha ability to add text to a graphic file, though I haven'e usedthem myself.

Chris

new topic     » goto parent     » topic index » view message » categorize

5. Re: Printing from euphoria on OSX box

ChrisB said...

Hi

I use enscript to format and print text files. ie

1. write out a temp text file. 2. enscript [options] text_file 3. delete the temp text file

enscript will print to the default printer using CUPS, but first converts a text file to an intermediate postscript file, but makes it a lot easier to do other stuff, like add borders, page numbers, orientation etc.

http://www.codento.com/people/mtr/genscript/enscript.man.html

If you want to print graphics then use the netpbm utilities to convert various types to output to a printer. I use this to convert and output fax images to a ps file for printing on a windows machine.

http://netpbm.sourceforge.net/

ppmdarw and ppmlabel would seem to have tha ability to add text to a graphic file, though I haven't used them myself.

Chris

Hey Chris...

Yeah! I use enscript from the Alpine MUA to print emails - works great! Never used the "netpbm" stuff.

Just to clarify - I don't have an OSX printing problem. I'm experiencing grief trying to coerce Euphoria to send output to a device - namely the printer, in OSX.

Thanks for the input! duke

new topic     » goto parent     » topic index » view message » categorize

6. Re: Printing from euphoria on OSX box

ChrisB said...
jimcbrown said...

For Linux and FreeBSD, you can replace "LPT1" with "/dev/lp" or "/dev/lp0" if you are using an old parallel port printer.

If you are using USB, it is tricker. You need to have a good understanding of the OS's device node naming conventions (devfs on FreeBSD and probably udev on Linux) to figure it out.

It is probably easier to print on Linux and FreeBSD by writing to a temporary file (e.g. "/tmp/temp.txt") and then running lpr (e.g. system("lpr /tmp/temp.txt", 2) ) than trying to open and write to the printer directly.

Hi

I use enscript to format and print text files. ie

1. write out a temp text file. 2. enscript [options] text_file 3. delete the temp text file

enscript will print to the default printer using CUPS, but first converts a text file to an intermediate postscript file, but makes it a lot easier to do other stuff, like add borders, page numbers, orientation etc.

http://www.codento.com/people/mtr/genscript/enscript.man.html

If you want to print graphics then use the netpbm utilities to convert various types to output to a printer. I use this to convert and output fax images to a ps file for printing on a windows machine.

http://netpbm.sourceforge.net/

ppmdarw and ppmlabel would seem to have tha ability to add text to a graphic file, though I haven'e usedthem myself.

Chris

I solved the issue buy taking both yours and Jim's advice. Using system("enscript <file_name>", 2) or system("lpr <file_name", 2) works just fine on *nix boxes. Should this be written up somewhere - Tips-N-Tricks / Hints / HOWTOs?

Thanks again U 2! duke

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu