# Convert .jpg to .pcl



## stufine (Jul 27, 2001)

Is there any Unix programs out there that will convert a .jpg to a pcl.

The reason I am wanting to do this is so I can print the picture from a command line and send it to the printer.


----------



## codejockey (Feb 11, 2002)

Assuming that the conversion itself can be interactive (i.e., not done from the command line), I think Electric Eyes may do what you want. I was able to read a .jpg file and save it as a .pcl file, although I could not print the .pcl file properly (may be my printer or the way I've configured lp spooling, though). The .jpg file printed fine from within Electric Eyes, however, which suggests that the conversion is OK. Electric Eyes is included in many Linux distributions.

If you need the conversion itself to be done from the command line, you might research what's available in the gimp, since it has a batch language that can be used to run scripts, etc.

Hope this helps.


----------



## stufine (Jul 27, 2001)

I am not ignoring your response.

I am still trying to try your suggestions

Thanks!!


----------



## codejockey (Feb 11, 2002)

Just in case I misunderstood your post: it's perfectly possible to print graphics files (in many different formats) from the command line on a laser (or inkjet or dot-matrix) printer, using the lp subsystem (lpr or lprng). To do this, you will need what's called a "magic filter" -- and the one I recommend is (oddly enough) magicfilter (there are others). So, for example, if you wish to print a jpeg file from the command line, you would use a command such as:

lpr -P laser image.jpg

and your laser printer would happily print the jpeg file (assuming you had installed and configured lp spooling correctly and were using a magic filter). Let me know if this is what you intended; if so, forget my previous post, as I now understand what you really have in mind.

Sorry for being dense, and hope this helps.


----------



## stufine (Jul 27, 2001)

That is exactly what I am trying to do. I will try your last response and let you know!!!

Thanks


----------



## stufine (Jul 27, 2001)

I tried magicfilter and could never get it installed. It was wanting too many different things that SCO doesn't come with. I downloaded tons of extra tools but it still won't compile. Still looking though and will let you know what I find out.


----------



## stufine (Jul 27, 2001)

WOO HOO!!!! I am almost there. I installed XV and it works great.

Now I just need to figure out how to get it to print from the command line.


----------



## codejockey (Feb 11, 2002)

Great work! Glad to hear that you are making progress. In addition, you provided a critical piece of information when you mentioned SCO as your Unix version. Now it's been awhile since I used SCO (Unix, Xenix) but my recollection is that SCO is based on AT&T Unix System V.X (most recently, V.4, I think). Anyway, System V Unixes typically use lp as the command to print documents; print management is done via commands such as lpadmin and lpstat. The lp spooling system relies on a series of directories (/var/spool/lp and below, I believe) to control the mapping of logical printers to physical printers (i.e., the same physical printer can have more than one logical mapping -- imagine a laser printer in portrait and landscape mode, for example). You might begin at the lp man page (try man lp from the command line) and see if that's helpful. 

There's no reason why magicfilter couldn't work in a System V-based system; at first blush, I'd expect it would be invoked from the interface file for each logical printer defined to the system. 

Hope this helps.


----------

