Re: Printing from euphoria on OSX box

new topic     » goto parent     » topic index » view thread      » older message » newer message
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 thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu