当前路径:Classes/PHPExcel/Reader/HTML.php <?php if (!defined('PHPEXCEL_ROOT')) { /** * @ignore */ define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); } /** * PHPExcel_Reader_HTML * * Copyright (c) 2006 - 2015 PHPExcel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel * @package PHPExcel_Reader * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## */ /** PHPExcel root directory */ class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader { /** * Input encoding * * @var string */ protected $inputEncoding = 'ANSI'; /** * Sheet index to read * * @var int */ protected $sheetIndex = 0; /** * Formats * * @var array */ protected $formats = array( 'h1' => array( 'font' => array( 'bold' => true, 'size' => 24, ), ), // Bold, 24pt 'h2' => array( 'font' => array( 'bold' => true, 'size' => 18, ), ), // Bold, 18pt 'h3' => array( 'font' => array( 'bold' => true, 'size' => 13.5, ), ), // Bold, 13.5pt 'h4' => array( 'font' => array( 'bold' => true, 'size' => 12, ), ), // Bold, 12pt 'h5' => array( 'font' => array( 'bold' => true, 'size' => 10, ), ), // Bold, 10pt 'h6' => array( 'font' => array( 'bold' => true, 'size' => 7.5, ), ), // Bold, 7.5pt 'a' => array( 'font' => array( 'underline' => true, 'color' => array( 'argb' => PHPExcel_Style_Color::COLOR_BLUE, ), ), ), // Blue underlined 'hr' => array( 'borders' => array( 'bottom' => array( 'style' => PHPExcel_Style_Border::BORDER_THIN, 'color' => array( PHPExcel_Style_Color::COLOR_BLACK, ), ), ), ), // Bottom border ); protected $rowspan = array(); /** * Create a new PHPExcel_Reader_HTML */ public function __construct() { $this->readFilter = new PHPExcel_Reader_DefaultReadFilter(); } /** * Validate that the current file is an HTML file * * @return boolean */ protected function isValidFormat() { // Reading 2048 bytes should be enough to validate that the format is HTML $data = fread($this->fileHandle, 2048); if ((strpos($data, '<') !== false) && (strlen($data) !== strlen(strip_tags($data)))) { return true; } return false; } /** * Loads PHPExcel from file * * @param string $pFilename * @return PHPExcel * @throws PHPExcel_Reader_Exception */ public function load($pFilename) { // Create new PHPExcel $objPHPExcel = new PHPExcel(); // Load into this instance return $this->loadIntoExisting($pFi...
完整源码文件,请先购买后再查看
相关源码
- JAVA+SPRINGBOOT心灵心理健康平台(心灵治愈交流平台)(含论文)源码2023-09-27
- JAVA+SPRINGBOOT+VUE工厂车间管理系统(含论文)源码2023-09-27
- JAVA_SSM+VUE校园二手物品交易平台(含论文)源码2023-09-27
- JAVA+SSM医院住院管理系统(含论文)源码2023-09-27
- JAVA VUE SSM教材管理系统(含论文、PPT)课程设计2023-09-27
- 基于SPRINGBOOT 旅游共享平台 + 论文2023-09-26
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2023. 京ICP备09089570号 | 京公网安备11010702000869号
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2023. 京ICP备09089570号 | 京公网安备11010702000869号