$txt = wfShellExec( $cmd, $retval );
wfProfileOut( 'djvutxt' );
if( $retval == 0) {
$txt = wfShellExec( $cmd, $retval );
wfProfileOut( 'djvutxt' );
if( $retval == 0) {
$txt = htmlspecialchars($txt);
$txt = preg_replace( "/\((page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*\"([^<]*?)\"\s*|)\)/s", "<PAGE value=\"$2\" />", $txt );
$txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";
$txt = htmlspecialchars($txt);
$txt = preg_replace( "/\((page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*\"([^<]*?)\"\s*|)\)/s", "<PAGE value=\"$2\" />", $txt );
$txt = "<DjVuTxt>\n<HEAD></HEAD>\n<BODY>\n" . $txt . "</BODY>\n</DjVuTxt>\n";