This function is called directly and converts a source file to an output file.
BOOL pascal KVHTMLConvertFile ( void *pContext, void *pCallingContext, char *pInFileName, char *pOutFileName, KVHTMLTemplateEx *pTemplatesEx, KVHTMLOptionsEx *pOptionsEx, KVHTMLCallbacksEx *pCallbacksEx, KVHTMLTOCOptions *pTOCCreateOptions, BOOL bIndex, KVErrorCode *pError)
|
A pointer returned from fpInit() or fpInitWithLicenseData(). |
|
A pointer passed back to the callback functions. |
|
A pointer to the input file. |
|
A pointer to the output file. |
|
A pointer to the If this pointer is |
|
A pointer to the If this pointer is |
|
A pointer to the If you do not use callbacks, this can be |
|
A pointer to the If this pointer is |
Set this to You can also set this through the bNoPictures member in the template files. |
|
|
A pointer to an error code if the call to |
If the call is successful, the return value is TRUE
.
If the call is unsuccessful, the return value is FALSE
.
Only pContext
, pInFileName
, pOutFileName
, and bIndex
are required. All other pointers should be NULL
when they are not set.
If pCallbacksEx
is NULL
, pOptionsEx->pszDefaultOutputDirectory
must be valid, except when you set bIndex
to TRUE
.
This function runs in-process or out of process. See Convert Files Out of Process.
When converting out of process, this function must be called after the call to KVHTMLStartOOPSession()
and before the call to KVHTMLEndOOPSession()
.
When converting out of process, the values for the KVHTMLTemplateEx
, KVHTMLOptionsEx
, and KVHTMLTOCOptions
structures should be set to NULL
. These structures are already passed in the call to KVHTMLStartOOPSession()
. SeeKVHTMLStartOOPSession().
if(!(*KVHTMLInt.KVHTMLConvertFile)( pKVHTML, /* A pointer returned by fpInit() */ NULL, /* A pointer for callback functions */ &InputFile, /* Input file */ &OutputFile, /* Output file */ &HTMLTemplates, /* Markup and related variables */ &HTMLOptions, /* Options */ NULL, /* A pointer to callback functions */ NULL, /* TOC options */ FALSE, /* Index mode */ &error)) /* The error return value */ { printf("Error converting %s to HTML %d\n", argv[i - 1], error); } else { printf("Conversion of %s to HTML completed.\n\n", argv[i - 1]); }
|