The Document Converter is initiated in a Job Admin context from the job launcher in CF8JOBADM.DLL.  The part of the launch process which relates to document conversion is handled as follows:

Each $job_document command is processed separately: the filename is expanded and the content-type and options are extracted.

If it is an HTML document for which variables are to be expanded ($job_options keyword HtmlExpandVars), it is scanned for BCF and BCX variables: if any are found, this will prevent preconvert, and a keyword ExpandBCFVars is added to the $job_document command.  If any other variables are found, a keyword ExpandVars is added instead.

If the WordMerge job option is set, and the file is a DOC, DOCX or RTF file, it is passed to REMOVEDS to remove the Data Source and to create a .FIELDLIST file containing the names of the merge-fields found in the document.  The .FIELDLIST file may also contain the dummy field names __ADDRESSBLOCK__ or __GREETINGLINE__ if these constructs were found in the document.  All real field names are then checked against the broadcast-list headers and will cause the launch to fail if mismatched.  If the .FIELDLIST file is empty, the document is not treated as a WordMerge document.

If the broadcast does not involve fax (broadcast type EB or SEB1) then no document conversion is scheduled and the $job_document command is converted to an $email_attach command with no check that the Content Type parameter is appropriate for the document.

If the broadcast does not involve e-mail (broadcast type FB) then the following processing for testing for PreConvert (which is also used in later steps as described below) is performed:

if the document type is not one of those specified on $convert_types, no further action

if BCF or BCX variables were found to be expanded, no further action

if the content-type starts with FONT it is assumed to be an ASCII file scheduled for transmission on a Brooktrout board, no further action

if a WordMerge document, no further action

if Preconvert job option not specified, no further action

otherwise, a target file name based on the UJP pathname with a suffix of _Cnn.TIF, where nn is the job-document index, is established

if there is no file with this pathname, or the file time is earlier than the original document time, or the source document is to be downloaded, a PreConvert operation is scheduled.

if the target file time is earlier than the UJP time (and variable NO_UJP_TIMECHECK is not set) then a PreConvert operation is scheduled).  In this case a Force Convert flag is also saved on the $job_document command to signal that file time comparisons in FFEXTERN or CVSINGLE are to be overridden.

if a PreConvert operation is scheduled for the document, then the target name is placed on the $job_document command as the second parameter, to signal to FFEXTERN what the target filename is to be.

if a PreConvert operation is not scheduled for the document, then a pre-convert must have been done already, so if this document is not specified for faxing (has 'nofax' keyword), the $job_document command can be deleted.  The target filename is retained for possible use in updating an $email_attach command.  [This command was not deleted earlier because it needs to be present (as a $fax_filename command) to force possible pre-conversion of the document for e-mail]

if a PreConvert operation is not scheduled for the document and is required for faxing, the presence of the _Cnn.TIF file indicates that the document has already been preconverted, and the target name replaces the original filename on the $job_document command, to act as the launch master document.

performing any part of the PreConvert test ensures that a remaining command with $job_document will be converted into a $fax_filename command; this will ensure that either a conversion will be performed or that the converted document will be faxed.

If the broadcast is a fax and e-mail broadcast (broadcast type FEB1 or FEB2) then:

if the document is to be faxed (i.e. there is not a nofax keyword) and there is no content type, the document is to be faxed only, so the processing for testing for PreConvert is performed as above and no $email_attach command is generated.

if the document is to be faxed and there is an e-mail content type,  the processing for testing for PreConvert is performed as above and an $email_attach command is generated.

Even if the document is not to be faxed, if the document to be attached is to have a content type which requires conversion, or if it is to be word-merged, the processing for testing for PreConvert is performed and an $email_attach command is generated.  This will be the case, for example, if a Word document is to be attached with an image/ content type, or as a PDF, either with or without the PDFattach convert option.

When an $email_attach command is generated from the $job_document command, then if a preconvert operation is scheduled for the document, the attachment filename is always the filename of the original document, so that FFEXTERN can match them.

When an $email_attach command is generated from the $job_document command, then if a preconvert operation is not scheduled for the document (i.e. it is being prepared for the real launch, either with an original document or with a preconverted document) then:

if the document is to be attached with a content type which matches its original format, the original filename is used, even if a conversion has been done for the purposes of faxing.

if the document is an Office document which has earlier been converted to PDF in a preconvert operation, it is attached with its new filename with extension changed to PDF.

otherwise, the attachment is given the new name of the converted document.

Finally all the $job_document commands are changed to $fax_filename commands in preparation for the launch.

Bulk Word Merge Mode

There is essentially no difference to the above processing when Bulk Word Merge is selected (by setting a job variable USE_WMDC to a non-empty value).  This allows other documents in the job to be preconverted normally if necessary before the job is launched in full.  The change in procedure comes at launch time, when:

FS files are written to a special folder named with the job instance name, under PREPROC, instead of into PREPROC itself

At the end of the launch, a consolidated broadcast list is written to a single TSV file named JOBn_WM.TAB in the job folder.

At the end of the launch, a special MSMQ message is written to signal FFEXTERN to start the full merge.

Currently, USE_WMDC is ignored when either a job Preview launch is requested  or when the job contains multiple documents which REMOVEDS detects as requiring WordMerge.

Suspending or canceling a job will cause any running merge to terminate.  A merge can be restarted using action 30, or from the JOBADMIN right-click menu.  Since items are moved out of the PREPROC subfolder as they are processed, the merge will resume at the next item.