Printing .jpg files with python

3470
2
04-22-2011 01:47 PM
MikePowell
New Contributor II
This might be a little off the ArcGIS aspect of the forum but I am having a terrible time trying to find anything on how to simply print an existing .jpg file with python. I have tried the win32api.ShellExecute. However, that only works with the default printer and certain Microsoft software packages (Obviously, when I open a .jpg file it opens something that doesn't understand ShellExecute, hence it doesn't work). I do not know how to associate the .jpg files with another program, I use to know, but that was way back in the day. I have tried win32print. That seems to be what I want, but I can't get it to print the .jpg file. I see it going into the printer queue but it only prints a blank piece of paper. I am not much of a programmer, I read some stuff on using ghostwriter but I can't seem to get that to download correctly and it seems a little more complicated than I really want it to be. Any help would be greatly appreciated
Tags (2)
0 Kudos
2 Replies
MattiasWallin
New Contributor II
0 Kudos
MikePowell
New Contributor II
Yes, I have, and I have tried it. It works but it doesn't seem to load the .jpg. It just prints a blank piece of paper. It looks like it is loading the .jpg in the queue but again nothing prints. Unless I am doing something wrong, which is entirely possible.
0 Kudos