Jump to content

What's a good way to print an image file?


 Share

Recommended Posts

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

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

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

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

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 imagemagick

irfanview command line samples can be found here:

http://www.robvanderwoude.com/commandlineswitches.php#IrfanView

Link to comment
Share on other sites

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.

post-29172-0-19964200-1331676545_thumb.p

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...