You will have to get low level using the win32 api. The easiest call that you can make is the ShellExecute (in shell32.dll) function which examines the extension of the data file and checks the registry to determine the application handling the extension.
Then it starts the application and instructs it in this case to print the file.Most applications will send the printout to the default printer.So if you set the default printer as the network printer it should be send there by the registered application.
But note that this works IF the registered application sends it to the printer with no user intervention,which maybe requires some tweaking.

The Win32::API module interfaces with the system dlls and calls the functions residing in them. Since the dlls are written in C it means getting deep into unmanaged code with,of course, all its associated risks!
You will have to allocate and deallocate memory and then parse the printing structures using padding specific to the the windows architecture.Which means,amongst others,abusing the 'pack' and 'unpack' functions!Pack to create the structures needed and subsequently passing them into the dll's.And 'unpack' for parsing the resulting structures!

But since in this case you only have to call on function it might be a bit easier. If you don't want to use the Shellexecute function then you can use GDI calls (much much harder) Start by looking the MSDN website. gdi for jpg
Some time ago I wrote a program that manipulated the printer queue as i wanted to capture the output of report generated on unix server and sent, using special escape codes of the terminal emulator, to the local printer ie. the default windows printer.
The program monitors the windows printer queue,captures and embeds html tags to the report and redirects it to Internet explorer.
If you are interested in that stuff PM me

In reply to Re: Print a jpg file to a printer (on Windows) by nikosv
in thread Print a jpg file to a printer (on Windows) by slloyd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.