een doc bestand omzetten naar html
Weet iemand of dit mogelijk is
ik heb een map maar word bestanden instaan nu wil ik die op de website weergeven
eigenlijk wil ik dus weten of er een script is die word bestanden zodat hij word weergegeven zonder te downloaden
bijvoorbaat dank
Arjan
bedank voor de informatie
ik heb dit script gedownload maar nu doet hij niks ik weet niet wat ik fout doe weet jij dat misschien
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?
$wvware = "/usr/bin/wvWare";
$wvware_options = "-d";
function updateword($wordfilename, $htmlfilename) {
global $wvware, $wvware_options;
$htmldir = dirname($htmlfilename);
/* ensure that we get any images into the html directory */
exec("$wvware $wvware_options $htmldir $wordfilename > $htmlfilename");
readfile($htmlfilename);
}
/* What absolute directory are we in on the file system? */
$basedir = dirname ( getenv ("SCRIPT_FILENAME") );
/* Work relative to this directory */
$wordfilename = $basedir . "mijndoc" . escapeshellcmd($name) . ".doc";
$htmldir = $basedir . "/";
$htmlfilename = $htmldir . escapeshellcmd($name) . ".html";
/* Sanity checks */
if (! file_exists($wordfilename))
die("Unable to open file $name ($wordfilename). Set URL variable " .
"?name=xxx to the base filename of the word file (e.g. try " .
"for try.doc). Do not include path! This script should be in " .
"the wordconv subdirectory to the .doc file.");
if (! is_dir($htmldir))
die("Directory $htmldir does not exist. It must be " .
"created and readable and writable by your web server.");
if ((! is_writeable($htmldir)) || (! is_readable($htmldir)))
die("Directory $htmldir must be readable and writable by your " .
"web server.");
if (file_exists($htmlfilename) && (! is_writeable($htmlfilename)))
die("The html file ($htmlfilename) exists already but is not " .
"writable by the web server.");
if (! file_exists($wvware))
die("The wvWare executable file $wvware cannot be found. Please " .
"ensure that the \$wvware variable in the script is pointed " .
"to your wvware executable.");
if (! is_executable($wvware))
die("The wvWare executable file $wvware is not " .
"executable by the web server process. Please change the file " .
"permissions to make it executable.");
/* Do the work */
if (file_exists($htmlfilename)) {
/* Do we need to update the html file? */
if (filectime($wordfilename) > filectime($htmlfilename))
updateword($wordfilename, $htmlfilename);
else readfile ($htmlfilename);
}
else updateword($wordfilename, $htmlfilename);
?>
$wvware = "/usr/bin/wvWare";
$wvware_options = "-d";
function updateword($wordfilename, $htmlfilename) {
global $wvware, $wvware_options;
$htmldir = dirname($htmlfilename);
/* ensure that we get any images into the html directory */
exec("$wvware $wvware_options $htmldir $wordfilename > $htmlfilename");
readfile($htmlfilename);
}
/* What absolute directory are we in on the file system? */
$basedir = dirname ( getenv ("SCRIPT_FILENAME") );
/* Work relative to this directory */
$wordfilename = $basedir . "mijndoc" . escapeshellcmd($name) . ".doc";
$htmldir = $basedir . "/";
$htmlfilename = $htmldir . escapeshellcmd($name) . ".html";
/* Sanity checks */
if (! file_exists($wordfilename))
die("Unable to open file $name ($wordfilename). Set URL variable " .
"?name=xxx to the base filename of the word file (e.g. try " .
"for try.doc). Do not include path! This script should be in " .
"the wordconv subdirectory to the .doc file.");
if (! is_dir($htmldir))
die("Directory $htmldir does not exist. It must be " .
"created and readable and writable by your web server.");
if ((! is_writeable($htmldir)) || (! is_readable($htmldir)))
die("Directory $htmldir must be readable and writable by your " .
"web server.");
if (file_exists($htmlfilename) && (! is_writeable($htmlfilename)))
die("The html file ($htmlfilename) exists already but is not " .
"writable by the web server.");
if (! file_exists($wvware))
die("The wvWare executable file $wvware cannot be found. Please " .
"ensure that the \$wvware variable in the script is pointed " .
"to your wvware executable.");
if (! is_executable($wvware))
die("The wvWare executable file $wvware is not " .
"executable by the web server process. Please change the file " .
"permissions to make it executable.");
/* Do the work */
if (file_exists($htmlfilename)) {
/* Do we need to update the html file? */
if (filectime($wordfilename) > filectime($htmlfilename))
updateword($wordfilename, $htmlfilename);
else readfile ($htmlfilename);
}
else updateword($wordfilename, $htmlfilename);
?>
Ik krijg geen foutmelding
ik zie helemaal niks hij doet het niet
Arjan
Je hebt de code uit die link bovenaan je pagina gezet?
dat heb ik gedaan
gewoon gecopieerd en geplakt
map aangepast
Je kan ook gewoon op een manier een wysiwyg implanteren op je site en dan gewoon de inhoud van je word bestand daarin plakken. Deze zet het dan meteen om naar html.
Dat zou kunnen maar ik wil graag gewoon dat mensen een doc bestand uploaden en dat het dan als tekst zichtbaar word
Arjan