Raindancer Posted August 18, 2005 Share Posted August 18, 2005 Hello 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 Link to comment Share on other sites More sharing options...
Michel Claveau Posted August 18, 2005 Share Posted August 18, 2005 Simple, facile, efficace ! Cool ! et... Merci ! Link to comment Share on other sites More sharing options...
layer Posted October 4, 2005 Share Posted October 4, 2005 (edited) 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 Edited October 4, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now