preexporthook
preexporthook
Function prototype:
hook(arr[])
Synopsis
Use with:
add_hook(hookname, func[, prepend])
remove_hook(hookname, func)
where hookname is preexporthook.
This hook is called before the export process begins, just after the user supplies the desired parameters on the Export Document dialog box. The hook function is passed an array containing all the input parameters as specified on the document_export function (or from the dialog box), and may override the settings by altering the array. If the hook function returns -1, the export operation will be cancelled, causing document_export to return 0. If the hook modifies any of the parameters in the array, it must return 1. Otherwise, the function should return 0.
Argument
arr is an array parameter whose elements contain the document_export parameters indexed as follows:
• 1 — the input path name inFile
• 2 — the output path name outFile
• 3 — the output file format outFileFmt
• 4 — the map file path name mapFile
• 5 — the style template file path name styleTmplt
• 6 — the log file path name logFile
• 7 — the boolean batchMode value
Example
In the following example, the hook function forces the export process to use a different style template by changing the styleTmplt parameter.
function PreExportHook(arr[])
{
arr[5] = "//server/templates/company.dot";
return 1; # signal array was changed
}
add_hook("preexporthook", "PreExportHook");
Related Topics