Server Conversion Engine Description
...Back to Downloads
Convert Windows document files to TIFF and JPEG documents under program control. Supported documents include any document for which a native application can be used to 'print' to a conversion server. ie: To convert Word Documents to TIFF, you need to have WORD installed.
To install:
Unzip ODC_SERV.ZIP, and run 'setup.exe'.
Applications are installed in the Start/Programs/ImageMAKER ODC Server program group.
Uses:
Document Conversion to TIFF or TXT file format for archival storage and document delivery.
Quick Start Instructions:
1) From the Start / Programs/ ImageMaker Document Conversion menu, select the C++ Sample Application.
2) From the Sample Application, select "convert…", and choose a file to convert. Supported file types include WORD, EXCEL, HTML, TXT, and any other Windows supported file types (with an associated owner application).
3) On completion of printing, view the result in the pop-up viewer.
4) To view the ‘text only’ contents, select ‘view shadow file when done’ option.
5) To batch convert a number of files, select the 'Batch Document Conversion' application.
The following programatic interfaces are provided to control document conversion:
CPServ.exe
- test application written in C++ that controls converting single documents to JPEG or TIFF. This is the test application to confirm that documents are converting.
ODCAXS.OCX
- Windows OCX control called by CPServ to handle the actual conversion. Sample code provided in CPSample.zip (C++), and VBSample.zip (Visual Basic).
ODCBatch.exe
- A fully developed application to control conversion of thousands of documents. Will poll a source directory, or can be pre-loaded with lists of files to convert. Also supports a command line command.
KODAK upgrade
- A post processing utility that converts files to a KODAK archive writer compatible format. Upgrades ODCBAtch.exe.
EMAIL upgrade
- Pre-processor support for Microsoft Outlook PST and MSG files. Also support for ZIP files. Upgrades ODCBAtch.exe.
ODCDAEMON.EXE
- controls all document conversion tasks, and monitors conversion status. The WPdaemon can be trained to look for, and to close application dialogs. It will also close applications if a timeout condition is detected.
Supported timeouts are as follows:
        Timeout on Job Start
        Timeout printing first page
        Timeout printing subsequent pages
        Timeout on total job
        Timeout waiting for print queue to clear
        Maximum number of pages exceeded
Using the Daemon Application:
When you run the test, you may also find that some documents when printed put up a dialog that needs to be closed. This is handled by the ODCDaemon application (that is also already started and running). ODCDaemon.EXE can be trained to close application windows automatically. By ODCDaemon.exe learning through experience, problems with applications sticking should eventually be overcome.
To 'teach' ODCDaemon, you need to do the following:
  1)    When the printing application gets stuck (ie: a message box is displayed to which you need to answer) switch to the ODCDaemon application (which should be visible, or is accessable from the System Tray).
2) From the ODCDaemon.exe menu, choose 'Configure',
3) From the ODCDaemon.exe configuration dialog, look for the Auto-Close Dialogs settings, select 'ADD', and right click on the magmifying glass, dragging it over to the button to be closed in the printing application that is stuck.
4) Then be sure to select OK, and the application message dialog should close, and the conversion process continue on its way.
The 'auto close' settings are currently stored in the registry. They can optionally be added to the 'setup.ini' file so that they are set at the time of install. (see examples in setup.ini under [WinNTxRegEntries]).
Throughput (speed):
On a single machine (PII 500MHz) a 5 page Word document converts in 5.2 seconds, an 11 page Word documents converts in 6.6 seconds. System resources are maxed out, and there is no advantage to trying to do multiple simultaneous conversions.
If WORD is left up (and doesn't have to re-load itself each time), the time to print is reduced by about 20%. To get conversion down to 1 second per document can be accomplished by adding additional 'slave' computers. (ie do 5 simultaneous conversions, each on a different slave).
To increase throughput:
- set the dithering to Windows Fast Dither.
- pre-load the core applications (like Word, Acrobat). These should be running, not   minimized, but make the display window as small as possible (reduces painting time).
- scalability can be supplied by adding additional computing power. We can provide you   with the instructions to control conversion remotely across multiple machines.
ODCBatch Command Line Options: (see discussion in UsrGuide.doc)
/A - start in AutoRun mode
<wildcards> - string of wildcards for selecting files to convert
<start dir> - starting directory for looking for files to convert
/R - recursively look for files to convert\
<output dir> - output directory
/N - Do NOT base output file name on input file name
/E - Do NOT include input file extension in output file name
<filetype> - output file type (integer). Default: TIF G3 Reversed
            0 – TIF G3 Reversed
            1 – TIF G3 Normal
            4 - TIF G3 (2D) Reversed
            5 – TIF G3 (2D) Normal
            6 - TIF G4 Reversed
            7 – TIF G4 Normal
<printer> - name of printer to use for conversion
/U - show UI. Don't convert but set options based on parameters
/? - show usage message
NOTE: If any parameters are specified (except /U) the program will run in 'silent mode'
Program will go out and do a 'one time' pass through converting all files that match the string. It returns with # of files converted, or an error code otherwise.
If any parameter is not specified, then we use standard default in ODCBatch.
If the -u parameter is used, then we do not 'automatically' do the conversion, but only set defaults, and bring up the UI.
Error Return Codes:
number of pages printed
else:
     -1 problem parsing command line
     -2 timeout connecting to Daemon
     -3 Keyboard hit
     -4 Output File name likely invalid (or is an existing directory)
     -5 Daemon not running
     -6 Daemon not running
      0 Daemon timed out (global daemon setting)
     -11 Timeout on job start (global daemon setting)
     -12 Timeout on first page (global daemon setting)
     -13 Timeout on subsequent page (global daemon setting)
     -14 Maximum pages exceeded (global daemon setting)
     -15 PdFilCnv timed out (/o setting)
     -16 Timed out waiting for PrintQueue to empty
Questions and Answers:
Question:
I have a question about using the img32mm.dll to create the mmshadow.txt file. With the process I'm currently developing there isn't a need to create a text file, so I've deleted the DLL as per the instructions that you included with the drop you sent Carl Hansen last month. While this is fine for now, I see potential future use for this feature and am wondering if there is any way to programmatically enable/disable this feature instead of tampering with the DLL file.
Answer:
Under Printer Properties / Device Settings / FaxBatch Library you can set this string to "" (blank) in order to disable the mmshadow.txt file from being created. Then re-set the string if you want to get the shadow file back. The registry setting can also be programatically modified, and lives at:
Question:
Is the product multi-threaded, i.e., if we execute two requests parallely, will they be processed parallely and the reply sent to the requesting party? Because, we run the "pdfilconv.exe" from our multi-threaded application but after the request is submitted to the driver, we see the tiff file is formed / printed only sequentially (the application executes the requests parallely)
Answer:
Yes, the product is multi-threaded; however, as it is based on the Microsoft Windows printer architecture, output through the printer is serialized -- it would not make sense to have the same printer printing two print jobs at the same time. In order to get multiple threads of execution running through the conversion server, it is necessary to create multiple printer instances, or multiple port instances, and then a print job will be submitted through each port. There are several concerns about this, however; one of the main ones is that the programs doing the printing may not be totally thread-safe. We have found, for instance, that Microsoft Office (which is invoked to do conversions from Word and Excel), while it can be invoked multiple times in order to do multiple conversions, in fact siphons all of its OLE functions through the first instance opened, losing any benefit you would gain by having multiple copies open. Another concern is that the rendering process is in fact compute-bound, and takes up all available processor clocks when a page image is being generated; this is because the actual rendering process happens in the kernel, and as such is scheduled whenever there is an available cycle. Very little advantage would be gained by having two or more printer instances running on a uniprocessor machine; the practical limit to the speed improvement is one printer / port instance per processor.
Question:
Your product description says that the product has been tested for 1 million continous pages in server based environment. Where as, we see that the requests are sequentially processed. If the product is multi threaded, what are the requirements to make your product accept and process parallel requests? FYI, the environment we use is as follows:

      a. The custom application runs on Windows 2000 professional.
      b. The file to be converted is opened thru notepad.
Answer:
The specific test application was a VB app that produced a single-page, very simple document, in a very tight loop, printing it each time. This app was used to confirm that there were no resource leaks in the print driver. It was not accepting parallel requests. It was used specifically to test the core component (the printer driver). I do not believe a similar test has yet been run on the document conversion shell, but such a test is obviously required. I will be putting together such a test and will report results on the web page.
Question:
Should we run the "ODCDaemon" application to make the product accept parallel requests?
Answer:
ODCDaemon is intended to allow the document conversion server to close any message boxes that appear on the server, primarily; as it is taught about message boxes, it will close them. I do not believe it will assist with multi-threading.
Question:
Also we find that the driver becomes slow upon continous usage. The first few requests, the driver converts the text file to tiff file very fast. But after 4 hours of continous usage, we see that the driver conversion becomes very slow. What may be the reason for this?
Answer:
The dll's are currently set up to create a log file. The most likely scenario is that the log file has filled the hard drive. We can provide you with a version with the log file turned off via software control.

In response to your earlier comments to the sales team about supporting multiple simultaneous conversions: If the volume of conversions is great enough that a single conversion server is not sufficient to handle them, then you would be looking at our "carrier-grade" solution. This uses multiple cheap machines to handle the actual conversions, with one central (and critical) machine doing the dispatch to the conversion servers. None of the conversion machines is then critical; any of them can be rebooted, or in the case of a more serious problem, can taken out of action and re-imaged, without stopping the conversion process.
Question:
I have a question about the timeout parameter. Is this the time it takes for the word processor to complete, or the word processor plus the printer driver's TIFF conversion.
Answer:
There are three timeouts that the user has control over:
  OCX: number of retries.

Default is 300 seconds. This is the number of times to attempt to connect to ODCDaemon from the OCX (approximately 1 second per retry).

Can be set from the registry, HKCU\software\ImageMAKER\odcsrv\ConnectRetries

or by calling the method SetProperty(0x8, VT_I2, propVal). ie: void CODCAXS::SetConnectRetries(short propVal)
{
  SetProperty(0x8, VT_I2, propVal);
}

  OCX: job timeout.

Default is 480 seconds (8 minutes). Amount of time to wait for job to complete printing before timing out.

Can be set from the registry, HKCU\software\ImageMAKER\odcsrv\PrintJobTimeout

or by calling the method SetProperty(0x9, VT_I2, propVal). ie: void CODCAXS::SetPrintJobTimeout(short propVal)
{
   SetProperty(0x9, VT_I2, propVal);
}

  ODCDaemon: AutoKillApp

Default should be 10 minutes. If the job hasn't finished printing in 10 minutes, and the application is listed as one of the apps to look for and kill, then the PIPE call returns, and if the printing application window is registered, the application is automatically terminated. This value should be more than the job timeout value (see above).

Can be set from the registry,
HKCU\software\ImageMAKER\wpDaemon\Settings\AutoKillAppTimeout

or. Set from the User Interface in the ODCDaemon application.
Service/Configure AutoKill Timeout.

The OCX 'number of retries' is number of seconds to wait to get the serial conversion pipe.

The OCX 'Job timeout' value is the amount of seconds to wait before timing out after connecting to the ODCDaemon application pipe. The call returns after the APP prints, and the tiff file is generated.

The ODCDaemon has its own timer (which should be set to longer than your OCX job timeout value) where it can 'autoclose' the currently active window. Ie: if there is a WORD autoclose specified, and the timeout is 300 seconds, 300 seconds after starting the printdoc, the ODCDaemon will close Word.

Technically speaking, OCX can time out, but the print process may still continue. This would happen for very complicated documents. If you were to start another print process, it may still go through while the previous one completes (entirely dependent on the printing application, and how well it handles multi-tasking). Our suggestion would be to make the AutoClose about double the timeout value of your printdoc timeout.

Question:
What parameters do I have control over at setup time?
Answer:
The following values in Setup.ini can be modifed:
ODC Settings:
[WinRegEntries]
RegEntry1="HKCU;software\imagemaker\odcsrv;OutputDirectory;STR;%INST_DIR%" RegEntry2="HKCU;software\imagemaker\odcsrv;OutputFileName;STR;output.tif" RegEntry3="HKCU;software\imagemaker\odcsrv;PrinterName;STR;%PRINTER_NAME%" RegEntry4="HKCU;software\imagemaker\odcsrv;OutputFileType;INT;0" RegEntry5="HKCU;software\imagemaker\odcsrv;ColourSupport;INT;0" RegEntry6="HKCU;software\imagemaker\odcsrv;MultiplePagesPerFile;INT;1" RegEntry7="HKCU;software\imagemaker\odcsrv;CommandMode;INT;2" RegEntry8="HKCU;software\imagemaker\odcsrv;PrintJobTimeout;INT;360" RegEntry9="HKCU;software\imagemaker\odcsrv;ConnectRetries;INT;300" RegEntry10="HKCU;software\imagemaker\odcsrv;LogEnabled;INT;1" RegEntry11="HKCU;software\imagemaker\odcsrv;ServerName;STR;"

ODCDaemon Settings:
[WinRegEntries]
RegEntry12="HKCU;Software\ImageMaker\Wpdaemon\Settings;PrinterName;STR;%PRINTER_NAME%" RegEntry13="HKCU;Software\ImageMaker\Wpdaemon\AutoCloseDlgs;Window0;STR;Microsoft Word:bosa_sdm_Microsoft Word 8.0" RegEntry14="HKCU;Software\ImageMaker\Wpdaemon\AutoCloseDlgs;Window1;STR;Microsoft Word:#32770" RegEntry15="HKCU;Software\ImageMaker\Wpdaemon\AutoKillApps;Window0;STR;Microsoft Word:OpusApp" RegEntry16="HKCU;software\imagemaker\odcsrv;InstallPath;STR;%INST_DIR%"

Print Driver Settings (more to follow):
[WinNT5DriverSet]
DefaultRes=4 ; 1: 204x98, 2: 204x196, 4: 200x200
; Dither modes:
; 0 - dmDefault, // Interpreted as "No change" on update
; 1 - Monochrome, // Monochrome, no dithering (Win95 None)
; 2 - ImgmakerDither, // Dither from 256 colors (Win95 Coarse setting)
; 3 - WindowsDither, // Use fast Windows dithering (Win95 Fine setting)
; 4 - ColorsToWhite, // All colors to white
; 5 - ColorsToBlack, // All colors to black
; 6 - ErrorDiffusion, // Error diffusion dithering (Win95 Error Diffusion setting)
; 7 - NoiseMask, // Noise mask dithering (Win95 Line art setting)
Dither=6
ActiveX Control DLL : ODCAXS
Control Name: ImageMaker Server ODC Control
Properties:
PrinterName (string) - name of printer to perform conversion (set to empty string for default printer)
OutputFileName (string) - name of output file (not the path), e.g. output.tif
OutputDirectory (string) - name of output directory, e.g. c:\temp
Methods:
LONG ConvertDocument( LPCTSTR lpInputFile, LPCTSTR lpOutputFile )
lpInputFile - file name and path of document to convert.
lpOutputFile - file name and path of desired output file. If this parameter is NULL or the empty string then property values OutputFileName and OutputDirectory are used instead.
returns: JOBID if successful, 0 otherwise
Events:
ConversionComplete( long jobId, long returnCode )
   - Fired when conversion process is complete.
   - jobId: ID of job completed.
   - returnCode:
      if > 0 then number of pages converted.
      if <= 0 then error.
       0 - print job timed out (increase value of PrintJobTimeout).
      -6 - connect retries expired (increase value of ConnectRetries).
      -5 - could not connect to server (check that daemon is running).
Appendix A: Setting File Associations
.TXT files
These convert fine under Windows 2000 using Notepad. For NT 4.0 and Win9x operating systems, the fix is to switch to use WordPad. (similar to renaming a .TXT file to .WRI).

Modify 'Text Document' in the file association as follows (For WinNT 4.0/Win9x only):
Print:
"C:\Program Files\Windows NT\Accessories\WORDPAD.EXE" /p "%1"
PrintTo:
"C:\Program Files\Windows NT\Accessories\WORDPAD.EXE" /pt "%1" "%2" "%3" "%4"

These replace the standard NotePad file associations. If the PrintTo entry does not exist, then you need to create it.

If you have any problems trying to find Wordpad, look for the 'Write Document' in the file association list. Then look at the 'PrintTo' entry, and you can copy it, then past it into the 'Text Document' setting.

To confirm, test a .TXT and a .WRI file. They should both convert similarily.
Corel 7.0 Print Settings:
The 'PrintTo' DDE settings are incorrect. Change them to be the same as 'Print'
DDE Message:
    [P("%1")]
DDE Application Not Running:
    [P("%1")][C()]
Microsoft Internet Explorer:
The first time you print to this application, use the Control Daemon to 'select' the default printer from the printer dialog box.
or...
You can also set this value dynamically by modifying the registry key:
          HKCU\Software\Microsoft\Internet Explorer\PageSetup\Printer

To force Internet Explorer to be the default print browser, from explorer / Options File Types, choose the extension type (htm, html, url), then use the 'change' button to pick the associated browser type. This seems to work better than any other method I've tried. Netscape can be quite difficult to replace.

File association for .htm is:
E:\Program Files\Microsoft Office\Office\msohtmed.exe" /p %1
For some reason, if Netscape is installed, the netscape EXE launches, instead of Internet Explorer. Temporary fix is to re-name the netscape directory... Still trying to track down the permanent fix, but it is likely something to do with the OLE registry.
Netscape/InternetExplorer and TIFF support from email
Get rid of the Macintosh QuickTime plug-in for TIFF.
Need to un-install from the Start/Settings/control Panel/AddRemove Programs/QuickTime Plug-in
PageMaker 6.5
Need to add a PrintTo file association (copy same as Print) for the .p65 file extension.
.JPG and .GIF
We've had best success using the Kodak viewer file association, where the Kodak viewer is set to the owner association. Same method, use the 'change' button to pick the viewer from the Explorer / Options / File Types / .JPG setting.
Adobe
We have found that the latest version of Adobe (Version 5.0) does not close the application after finishing printing. The fix is to 'open' a placehoder file in advance of printing. The application then switches to the file to be printed, prints it, and switches back to the placehoder file. To make sure this is always set up, specify in the startup group that the placeholder file be opened at login.
Word Perfect
Word Perfect 9.0 also does not close the file after printing. See same comments for Adobe.
Setting File Associations:
For a complete description on file associations, see: MSDN Home > MSDN Library > User Interface Design and Development > Shell Programmers Guide > Shell Basics > Shell Basics: Extending the Shell > Creating a File Association.

To check a file association, from a DOS prompt, type:
assoc .htm
[returns .htm=htmlfile]
ftype htmlfile [returns htmlfile="E:\Program Files\Internet Explorer\iexplore.exe" -nohome]
To get a list of all associations, type: assoc
To delete an association assoc .htm=.
To create an association assoc .new=NewType ftype NewType=%systemroot%\System32\notepad.exe %1

HKEY_CLASSES_ROOT contains file associations and OLE information.
Contains all the information necessary to launch applications:
- Holds information about the ActiveX controls installed. When an ActiveX control installs itself, it creates entries so that ActiveX container applications can find and use the control. These controls register themselves by name and they also have a unique numer called a class ID (CLSID).
- All the extensions and associations between applications and documents
- Names of all the drivers
- Strings used as pointers to the actual text they represent (for example, aufile actually represents AU Format Sound)
- Class ID numbers (numbers used intead of names for accessing items)
- DDE and OLE information
- Icons used for applications and documents

To trace a file association for .htm files:
HKEY_CLASSES_ROOT\.htm -> points to htmlfile
HKEY_CLASSES_ROOT\htmlfile ->Key values are stored in SHELL / PrintTo

To access the standard interface that defines file extensions, from Windows Explorer, or from 'My Computer', select the Options, file associations tab.
Sample are as follows:
Notepad:
Action:
Print
Application used to permorm action:
E:\WINNT\system32\NOTEPAD.EXE /p "%1"
Action:
PrintTo
Application used to permorm action:
E:\WINNT\system32\notepad.exe /pt "%1" "%2" "%3" "%4"

%1: filename to print
%2: printer name
%3: drivder name: "WINSPOOL" <- standard default
%4: port name: "NE01:" <- standard default
Microsoft Word:
Action:
Print
Application used to permorm action:
"E:\Program Files\Microsoft Office\Office\WINWORD.EXE" /x /n
DDE Message:
[REM _DDE_Minimize][FileOpen("%1")][t=IsDocumentDirty()][FilePrint 0][SetDocumentDirty t][DocClose]
Application:
WinWord
DDE Application not Running:
[FileOpen("%1")][FilePrint 0][FileExit 2]
Topic:
System
Action:
PrintTo
Application used to permorm action:
"E:\Program Files\Microsoft Office\Office\WINWORD.EXE" /n
DDE Message:
[REM _DDE_Minimize][FileOpen("%1")][FilePrintSetup "%2 on p",.DoNotSetAsSysDefault=1][FilePrint 0][DocClose 2][FilePrintSetup ""]
Application:
WinWord
DDE Application not Running:
[FileOpen("%1")][FilePrintSetup "%2 on p",.DoNotSetAsSysDefault=1][FilePrint 0][FileExit 2]
Topic:
System
Popular File Formats, and the 'shell print' command:
Notepad file notepad.exe /p filename.TXT
Lotus 1-2-3 worksheet 123w.exe -q filename.WKS
Printing DCX Images \WINDOWS\kodakprv.exe /p filename.DCX
DrWatsons Log \WINDOWS\DRWATSON.EXE /P logfilename
AWD fax documents \WINDOWS\kodakprv.exe /p filename.AWD
Printing a font file \WINDOWS\fontview.exe /p fontfile
Winfax faxes \WINFAX\WFVW32.EXE -p filename
Internet URL shortcuts rundll32.exe \WINDOWS\SYSTEM\MSHTML.DLL,PrintHTML filename.URL
Microsoft Excel \OFFICE\excel.exe /e filename.XLS
Microsoft HTML document \OFFICE\msohtmed.exe" /p filename.HTM
Microsoft BINDER file \OFFICE\binder.exe -p filename.OBD
Microsoft Powerpoint file \Office\PowerPnt.exe" /p filename.PPT
Microsoft Publisher \OFFICE\MSPUB.EXE /p filename.PUB
Microsoft Word Docs \Office\winword.exe" /x filename.DOC
Nicrosoft Info \MSINFO\MSINFO32.EXE /p filename.NFO
MS Outlook files \Office\outlook.exe /p filename.MSG
Pagemaker files \PM6\PM6.EXE filename.PM6
Webshots Screensaver \WSST.EXE /p filename.wss
WIF images \WINDOWS\kodakprv.exe /p filename.WIF
Write documents (wordpad) WORDPAD.EXE /p filename.WRI
XIF documents \WINDOWS\kodakprv.exe /p filename.XIF
Product overview and operation is provided in the USRGUIDE.DOC file.
Additional details also provided in the readme.txt file.


...Back to Downloads
Links