Jump to content


_PrintImage UDF

  • Please log in to reply
2 replies to this topic

#1 Raindancer



  • Active Members
  • PipPipPipPip
  • 229 posts

Posted 18 August 2005 - 08:07 AM


I had the problem that I needed a way to print an image from AutoIt.
I searched the Forum, and only fount the print.au3 UDF, which seems to be only able to print text (didn't test it, but was said so in the topic).

I found a Rundll32 call which is able to print images with the Windows Image and Fax Viewer. I made a function to print the image the a specified printer.

Func _PrintImage($filename, $printer)     If Not FileExists($filename) Then         SetError(1, "Specified file couldn't be found")         Return(0)     EndIf     $command = "RunDLL32.EXE shimgvw.dll,ImageView_PrintTo /pt " & $filename & " " & $printer     Run($command) EndFunc

I am sure it could be done with DllCall but I don't know where to start cause in MSDN i only found the RunDll32 call to use this function.
Maybe there is also a way to check if the specified printer is available, but also i didn't find out in the hurry how.

Hope you find it useful, and maybe someone can modify it to a DllCall Function.

Greetz Raindancer
Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer

#2 Michel Claveau

Michel Claveau


  • Active Members
  • PipPipPipPipPipPip
  • 352 posts

Posted 18 August 2005 - 11:09 AM

Simple, facile, efficace !

Cool !


Merci !

#3 layer


    i love skateboarding

  • Active Members
  • PipPipPipPipPipPip
  • 2,470 posts

Posted 04 October 2005 - 02:36 AM

Sorry to bump an old topic...

But I think it'd be nice if this were combined with the _FilePrint function that only prints text... Well, then you'd have to check for a lot of filetypes, well, maybe not. BLAH ! I'm too tired to think, just an idea... ;)

EDIT: Also, if you wanted to get around the problem of checking for the filetypes, then add an optional paremeter to say which file types could be printed... Again, just an idea, I'm sure there are many ways to do this :P

Edited by layer, 04 October 2005 - 02:39 AM.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users