PDA

View Full Version : سوال: تبدیل word به html



digitak
جمعه 31 اردیبهشت 1389, 18:09 عصر
سلام
نیاز به یک کد برای تبدیل فایل های word به html دارم

ممنون

pashaie
جمعه 31 اردیبهشت 1389, 18:20 عصر
به این پیج یه سر بزن

http://wvware.sourceforge.net/

digitak
جمعه 31 اردیبهشت 1389, 18:56 عصر
این که به زبان C++ هست !
اصلا هیچ فایل php توش نیست

pashaie
جمعه 31 اردیبهشت 1389, 19:29 عصر
این که به زبان C++‎‎ هست !شرمنده!
اشتباهی بود!!!


<?php



/************************************************** ***************
This approach uses detection of NUL (chr(00)) and end line (chr(13))
to decide where the text is:
- divide the file contents up by chr(13)
- reject any slices containing a NUL
- stitch the rest together again
- clean up with a regular expression
************************************************** ***************/

function parseWord($userDoc)
{
$fileHandle = fopen($userDoc, "r");
$line = @fread($fileHandle, filesize($userDoc));
$lines = explode(chr(0x0D),$line);
$outtext = "";
foreach($lines as $thisline)
{
$pos = strpos($thisline, chr(0x00));
if (($pos !== FALSE)||(strlen($thisline)==0))
{
} else {
$outtext .= $thisline." ";
}
}
$outtext = preg_replace("/[^a-zA-Z0-9\s\,\.\-\n\r\t@\/\_\(\)]/","",$outtext);
return $outtext;
}

$userDoc = "cv.doc";

$text = parseWord($userDoc);
echo $text;


?>



اگه سرورت همیشه آنلاینه، می تونی از سرویس این سایت استفاده کنی که خوشبختانه رایگان هم هست!
http://www.phplivedocx.org/articles/brief-introduction-to-phplivedocx/

digitak
سه شنبه 04 خرداد 1389, 22:00 عصر
متاسفانه کد شما کار نکرد !