Solved

Script file needed to automatically print an image file

Posted on 2004-08-23
8
404 Views
Last Modified: 2012-05-05
I didn't see a Topic area for scripting, so hope someone here can respond.

I have image files that need to be printed automatically so the user does not have to bothered with being familiar with a particular application in order to print a file.  I have successfully created a script file that addresses AutoCad files. This is accomplished with AutoCad's ability to use a script file. Now I need the same ability for some kind of viewer for jpg and tif files.

Does anyone know of a shareware image viewer that accepts commands from a script file that I could use to automate the printing of these other file types? Or some other method to do this automatically?
0
Comment
Question by:llap
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 12

Expert Comment

by:fulscher
ID: 11875289
I use QuickViewPlus which can display and print most image types (currently made by Stellent, http://www.stellent.com) and distributed by AvantStar (http://www.avantstar.com/intradoc-cgi/idc_cgi_isapi.dll?IdcService=SS_GET_PAGE&ssDocName=QuickViewPlusOverview). The list of supported format is here: http://www.avantstar.com/stellent/groups/public/documents/word_files/quickviewplus8formats.pdf

An eval version is available. There is a command line switch to print files without displaying them.

Don't expect too much, though.

Hope this helps
Jan
0
 
LVL 1

Author Comment

by:llap
ID: 11882794
Thanks Jan. I tried the QuickViewPlus as you referenced. It ALMOST does what I want. It will accept command line instructions - so I can start it and open a specific image file from a script file. The catch is QuickViewPlus does not have a command line parameter to format the printer - so what I get is the default 8 X 10, portrait instead of the 11 X 17 landscape that I want. When you run QuickViewPlus manually, it does remember your previous printer settings, but so far(I've talked to product support) they don't have a way to make this "completely" automatic in the format that I want.

I'll wait awhile to see if someone posts any other suggestions. I have looked at AutoPrint as another option -- haven't tried it yet. It's supposed to be able to print any file that you dump in a specific folder -- that could work OK as long as I can configure the printer. It's more expensive than QuickViewPlus.
John
0
 
LVL 12

Expert Comment

by:fulscher
ID: 11883050
Hm - I know it's kind of cheap - but the settings are stored in the registry in the key

HKEY_CURRENT_USER\Software\Inso\Quick View Plus\CurrentVersion

So, you could set the correct settings once, save them in a file and dump them to the registry before running QVP...

Jan
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Author Comment

by:llap
ID: 11884486
I've done almost zip as far as registry manipulation. Do you mean exporting the registry settings to a file, then importing that file back into the registry prior to firing up QVP??

Or... there is a printer settings "save" option (to a file)-- but I don't see how to automatically restore this file from a QVP command line.

I appreciate any further explanation you can offer.
Thanks in advance.
John
0
 
LVL 1

Author Comment

by:llap
ID: 11884713
OK, I think I'm handling the registry -- check me on this (still not solved though)

I set the printer settings in QVP (printed a 11 x 17 in landscape), went to registry and exported a file called qvp.reg. Then my script file is as follows:

  regedit /s qvp.reg
  "C:\Program Files\Quick View Plus\PROGRAM\qvp32.exe" -f? c:\tiftest.tif -sprn

BUT.....it didn't make a difference with the printing -- still got an 8x10, portrait

here's the contents of qvp.reg:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Inso\Quick View Plus\CurrentVersion]
"FNTreeHeight"=dword:000001df
"FNOpenedTo"=hex:14,00,1f,50,e0,4f,d0,20,ea,3a,69,10,a2,d8,08,00,2b,30,30,9d,\
  19,00,23,43,3a,5c,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,31,84,\
  00,00
"FNOpenedSize"=dword:0000002f
"QVPDimensions"=dword:0307041f
"FileNavigatorOffsets"=dword:00fe0064
"ShowSingleByDef"=dword:00000001
"Orientation"=dword:00000000
"PageView"=dword:00000000
"File Navigator Orientation"=dword:00000001
"AttachExplorerFlags"=dword:00000004
"Text Encoding"=dword:00000fa5
"HTML Encoding"=dword:0000044d
"Toolbar"=dword:00000001
"Statusbar"=dword:00000001
"ReuseWindow"=dword:00000000
"ShowFN"=dword:00000001
"AutoOptions"=dword:00000001
"StartupLogo"=dword:00000001
"UnsupportedTypes"=dword:00000002

I didn't see in the registry any reference that indicated it was saving the printer info there. Not sure where else to look --
We may be getting close
john

0
 
LVL 12

Accepted Solution

by:
fulscher earned 500 total points
ID: 11885032
Sorry for the delay. Dinner time, here.

I got the wrong registry key. Looks like printer settings are saved in the key HKEY_CURRENT_USER\Software\SCC\Viewer Technology\OEM99\Options and its subkeys. There are more settings in HKEY_CURRENT_USER\Software\SCC\Viewer Technology\OEM05 but I don't know what they do.

You got the registry bit precisely right.

Jan


0
 
LVL 1

Author Comment

by:llap
ID: 11886630
Jan,
Still no luck, even after getting the different registry info to replace the reg file.  I have contacted support at QVP to let them know what we're trying - asking for any suggestions.
I'll check back later after I've heard more (maybe not until tomorrow).
thanks
john
0
 
LVL 1

Author Comment

by:llap
ID: 11894160
OK - got it working. Registry tweaking appears to be the only way to automate using QVP - since they offer no additional printer options for landscape and paper size. Consequently, the registry settings that need to be modified are in the HKEY_CURRENT_USER\Printers\DevModePerUser.

I've simply created a reg file for 11x17 and one for 8.5x11 (in order to reset back to default after I'm done with my qvp print routine). This is not really what I anticipated I'd have to do, but it seems to work OK.

Jan, mostly what you did for me was forced me into a 1st lesson crash course in registry. Previously, I had looked around in there, but not really done any exporting/importing.  I've been warned that it's like playing with fire - so be careful. In fact, after initial registry mods had almost got this working - my script file that called qvp, got hung up (multiple attempts, restarts, etc.) so I ended up uninstalling/reinstalling qvp -- now my script along with the registry manipulation works.

script file: qvp_print.cmd:

  regedit.exe /s reg_11x17_landscape.reg
  "C:\Program Files\Quick View Plus\PROGRAM\qvp32.exe" -f? c:\tiftest.tif -sprn
  rem include a pause, otherwise printer gets reset to default too quickly
  pause
  regedit.exe /s reg_8halfx11_portrait.reg

I may actually run this routine on a seldom used computer that can just maintain a default 11x17 printer setting and avoid the registry manipulation, but I'm glad to understand how this is controlled.
Thanks again for your help. I'm accepting your answer and awarding the points.
john




0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question