Solved

Script file needed to automatically print an image file

Posted on 2004-08-23
8
393 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
  • 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now