function rtf::parseDocument in Bibliography Module 6.2
Same name and namespace in other branches
- 6 class_rtf.php \rtf::parseDocument()
- 7 modules/rtf/rtf_export.inc \rtf::parseDocument()
- 7.2 modules/rtf/rtf_export.inc \rtf::parseDocument()
1 call to rtf::parseDocument()
- rtf::getDocument in modules/
rtf/ rtf_export.inc
File
- modules/
rtf/ rtf_export.inc, line 307
Class
Code
function parseDocument() {
//$doc_buffer = $this->specialCharacters(html_entity_decode($this->document));
$doc_buffer = html_entity_decode($this->document, ENT_QUOTES);
$doc_buffer = utf8_decode($doc_buffer);
$doc_buffer = $this
->specialCharacters($doc_buffer);
if (preg_match("/<ul>(.*?)<\\/ul>/mi", $doc_buffer)) {
$doc_buffer = str_replace("<ul>", "", $doc_buffer);
$doc_buffer = str_replace("</ul>", "", $doc_buffer);
$doc_buffer = preg_replace("/<li>(.*?)<\\/li>/mi", "\\f3\\'B7\\tab\\f{$this->font_face} \\1\\par", $doc_buffer);
}
$doc_buffer = preg_replace("/<p>(.*?)<\\/p>/mi", "\\1\\par ", $doc_buffer);
$doc_buffer = preg_replace("/<strong>(.*?)<\\/strong>/mi", "\\b \\1\\b0 ", $doc_buffer);
$doc_buffer = preg_replace("/<em>(.*?)<\\/em>/mi", "\\i \\1\\i0 ", $doc_buffer);
$doc_buffer = preg_replace("/<i>(.*?)<\\/i>/mi", "\\i \\1\\i0 ", $doc_buffer);
$doc_buffer = preg_replace("/<u>(.*?)<\\/u>/mi", "\\ul \\1\\ul0 ", $doc_buffer);
$doc_buffer = preg_replace("/<strike>(.*?)<\\/strike>/mi", "\\strike \\1\\strike0 ", $doc_buffer);
$doc_buffer = preg_replace("/<sub>(.*?)<\\/sub>/mi", "{\\sub \\1}", $doc_buffer);
$doc_buffer = preg_replace("/<sup>(.*?)<\\/sup>/mi", "{\\super \\1}", $doc_buffer);
//$doc_buffer = preg_replace("/<H1>(.*?)<\/H1>/mi", "\\pard\\qc\\fs40 \\1\\par\\pard\\fs{$this->font_size} ", $doc_buffer);
//$doc_buffer = preg_replace("/<H2>(.*?)<\/H2>/mi", "\\pard\\qc\\fs32 \\1\\par\\pard\\fs{$this->font_size} ", $doc_buffer);
$doc_buffer = preg_replace("/<h1>(.*?)<\\/h1>/mi", "\\fs48\\b \\1\\b0\\fs{$this->font_size}\\par ", $doc_buffer);
$doc_buffer = preg_replace("/<h2>(.*?)<\\/h2>/mi", "\\fs36\\b \\1\\b0\\fs{$this->font_size}\\par ", $doc_buffer);
$doc_buffer = preg_replace("/<h3>(.*?)<\\/h3>/mi", "\\fs27\\b \\1\\b0\\fs{$this->font_size}\\par ", $doc_buffer);
$doc_buffer = preg_replace("/<hr(.*?)>/i", "\\brdrb\\brdrs\\brdrw30\\brsp20 \\pard\\par ", $doc_buffer);
$doc_buffer = str_replace("<br>", "\\par ", $doc_buffer);
$doc_buffer = str_replace("<br>", "\\par ", $doc_buffer);
$doc_buffer = str_replace("<tab>", "\\tab ", $doc_buffer);
$doc_buffer = $this
->nl2par($doc_buffer);
return $doc_buffer;
}