当前位置: 首页>>代码示例>>PHP>>正文


PHP CreateDocx::DOCX2TXT方法代码示例

本文整理汇总了PHP中CreateDocx::DOCX2TXT方法的典型用法代码示例。如果您正苦于以下问题:PHP CreateDocx::DOCX2TXT方法的具体用法?PHP CreateDocx::DOCX2TXT怎么用?PHP CreateDocx::DOCX2TXT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CreateDocx的用法示例。


在下文中一共展示了CreateDocx::DOCX2TXT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

<?php

require_once '../../../classes/CreateDocx.inc';
$options = array('paragraph' => true, 'list' => true, 'table' => true, 'footnote' => true, 'endnote' => true, 'chart' => 0);
CreateDocx::DOCX2TXT('../../files/Text.docx', 'document_1.txt', $options);
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:5,代码来源:sample_1.php

示例2: extract_text


//.........这里部分代码省略.........
                                            //  ignore all empty cells
                                            foreach ($cell as &$content) {
                                                $result .= "" . $content . " ";
                                                //  collect content of all cells
                                            }
                                        }
                                    }
                                }
                            }
                        } else {
                            $result = 'ERROR';
                        }
                        //      for ODT documents enter here
                    } else {
                        if ($source_type == 'odt') {
                            require_once "" . $converter_dir . "/odt_reader.php";
                            $x = new odt_reader();
                            // Unzip the document
                            $u = $x->odt_unzip($filename, false);
                            // read the document
                            $result = $x->odt_read($u[0], 2);
                            //  create some blanks around the <div> tags
                            $result = str_replace("<", " <", $result);
                            $result = str_replace(">", "> ", $result);
                            //echo "\r\n\r\n<br /> odt result: $result<br />\r\n";
                            //  for DOCX files enter here
                        } else {
                            if ($source_type == 'docx') {
                                //  converter class supplied by http://www.phpdocx.com
                                $options = array('paragraph' => false, 'list' => false, 'table' => false, 'footnote' => false, 'endnote' => false, 'chart' => 0);
                                $docx_file = "docx.txt";
                                $result = '';
                                require_once "" . $converter_dir . "/docx/CreateDocx.inc";
                                CreateDocx::DOCX2TXT($filename, $tmp_dir . "/" . $docx_file, $options);
                                if ($file = @file_get_contents($tmp_dir . "/" . $docx_file)) {
                                    $result = "{$file} ";
                                }
                                if ($index_xmeta) {
                                    require_once "" . $converter_dir . "/xmeta_converter.php";
                                    $docxmeta = new x_metadata();
                                    $docxmeta->setDocument($filename);
                                    /*
                                                    echo "Title : " . $docxmeta->getTitle() . "<br>";
                                                    echo "Subject : " . $docxmeta->getSubject() . "<br>";
                                                    echo "Creator : " . $docxmeta->getCreator() . "<br>";
                                                    echo "Keywords : " . $docxmeta->getKeywords() . "<br>";
                                                    echo "Description : " . $docxmeta->getDescription() . "<br>";
                                                    echo "Last Modified By : " . $docxmeta->getLastModifiedBy() . "<br>";
                                                    echo "Revision : " . $docxmeta->getRevision() . "<br>";
                                                    echo "Date Created : " . $docxmeta->getDateCreated() . "<br>";
                                                    echo "Date Modified : " . $docxmeta->getDateModified() . "<br>";
                                    */
                                    $result .= $docxmeta->getTitle() . $docxmeta->getSubject() . $docxmeta->getCreator() . $docxmeta->getKeywords() . $docxmeta->getDescription() . $docxmeta->getLastModifiedBy() . $docxmeta->getRevision() . $docxmeta->getDateCreated() . $docxmeta->getDateModified();
                                }
                                @unlink($tmp_dir . "/" . $docx_file);
                                /*
                                            if($result && $chrSet != "UTF-8") {
                                                $result = @mb_convert_encoding($result, "UTF-8", $chrSet);
                                            }
                                */
                                //  for XLSX spreadsheets enter here
                            } else {
                                if ($source_type == 'xlsx') {
                                    $result = '';
                                    $i = 1;
                                    $name = '';
开发者ID:hackersforcharity,项目名称:rachelpiOS,代码行数:67,代码来源:spiderfuncs.php


注:本文中的CreateDocx::DOCX2TXT方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。