qwert Posted March 13, 2012 Share Posted March 13, 2012 From my script, I have the file path and name of an image file (JGP or PNG). Is there a direct way for the script to request that the file be printed? IOW, the equivalent to _FilePrint, but for images. I can, of course, hand the file to the Windows Picture Viewer, but that just thows extra steps in for the user. Thanks in advance for any suggestions. Link to comment Share on other sites More sharing options...
martin Posted March 13, 2012 Share Posted March 13, 2012 One way is to use my print udf which has a link in my signature.You might also be able to create a small html file which contains the image and print that using Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
qwert Posted March 13, 2012 Author Share Posted March 13, 2012 martin, that's an excellent UDF solution. It will certainly do everthing I need and MUCH more. I will very likely use if for several scripts. But I do have to ask about these since you referenced them in your original post of your UDF:See also these udf's for printing from AutoIt using the Windows API and not using a dll.by GRS - http://www.autoitscript.com/forum/topic/...m-autoit/page__view__findpost_by Prog@ndy -http://www.autoitscript.com/forum/topic/...gdi-udfs/page__view__findpost_Is there a viable way to print a bitmap image directly, without using a dll? Neither link worked for me, but "no dll" would be the ideal solution for one particular script I'm working on.Thanks for your UDF ... and thanks for any additional help you might be able to provide. Link to comment Share on other sites More sharing options...
qwert Posted March 13, 2012 Author Share Posted March 13, 2012 Update: I was able to find the thread by GRS:I'll work through the posts, but, martin, your UDF is looking pretty good at this point. It covers so many bases. Link to comment Share on other sites More sharing options...
rodent1 Posted March 13, 2012 Share Posted March 13, 2012 (edited) to print to the default printer, you can use the command msPaint /p c:myfoldermybmp.bmp and use the -pt switch to specify the printer if you need to Edited March 13, 2012 by rodent1 Link to comment Share on other sites More sharing options...
qwert Posted March 13, 2012 Author Share Posted March 13, 2012 msPaint would be a good solution ... if it weren't for their idiotic default settings that cause a normal-sized image to be split across two pages ... on XP anyway. I've looked for years for a way to edit and save those settings. Do you know how?Thanks for mentioning it, though. Link to comment Share on other sites More sharing options...
rodent1 Posted March 13, 2012 Share Posted March 13, 2012 If your printer supports larger paper sizes, there are ways to change the printer's default paper size to for example tabloid (twice the letter size) from a command line using previously saved binary files that contain print default settings. If you need more info on how to do that, let me know. Otherwise, if you need to shrink the image size to force it to fit the letter paper size, you're stuck with other scripting solutions like gimp, or extra software like irfanview (http://www.irfanview.com/) or imagemagickirfanview command line samples can be found here:http://www.robvanderwoude.com/commandlineswitches.php#IrfanView Link to comment Share on other sites More sharing options...
qwert Posted March 13, 2012 Author Share Posted March 13, 2012 This is what I'm talking about. The default settings cause even nominal images to be split. Any reasonable software would do its best to put a requested image one page ... or at least ask about splitting. Thanks for your suggestions. 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