File indexing completed on 2024-12-22 05:36:56
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Pdf 0017 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0018 * @license http://framework.zend.com/license/new-bsd New BSD License 0019 * @version $Id: 0020 */ 0021 0022 /** Internally used classes */ 0023 // require_once 'Zend/Pdf/Element.php'; 0024 // require_once 'Zend/Pdf/Element/Array.php'; 0025 // require_once 'Zend/Pdf/Element/String/Binary.php'; 0026 // require_once 'Zend/Pdf/Element/Boolean.php'; 0027 // require_once 'Zend/Pdf/Element/Dictionary.php'; 0028 // require_once 'Zend/Pdf/Element/Name.php'; 0029 // require_once 'Zend/Pdf/Element/Null.php'; 0030 // require_once 'Zend/Pdf/Element/Numeric.php'; 0031 // require_once 'Zend/Pdf/Element/String.php'; 0032 0033 0034 /** 0035 * Resource extractor class is used to detach resources from original PDF document. 0036 * 0037 * It provides resources sharing, so different pages or other PDF resources can share 0038 * its dependent resources (e.g. fonts or images) or other resources still use them without duplication. 0039 * It also reduces output PDF size, required memory for PDF processing and 0040 * processing time. 0041 * 0042 * The same extractor may be used for different source documents, several 0043 * extractors may be used for constracting one target document, but extractor 0044 * must not be shared between target documents. 0045 * 0046 * @package Zend_Pdf 0047 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0048 * @license http://framework.zend.com/license/new-bsd New BSD License 0049 */ 0050 class Zend_Pdf_Resource_Extractor 0051 { 0052 /** 0053 * PDF objects factory. 0054 * 0055 * @var Zend_Pdf_ElementFactory_Interface 0056 */ 0057 protected $_factory; 0058 0059 /** 0060 * Reusable list of already processed objects 0061 * 0062 * @var array 0063 */ 0064 protected $_processed; 0065 0066 /** 0067 * Object constructor. 0068 */ 0069 public function __construct() 0070 { 0071 $this->_factory = Zend_Pdf_ElementFactory::createFactory(1); 0072 $this->_processed = array(); 0073 } 0074 0075 /** 0076 * Clone page, extract it and dependent objects from the current document, 0077 * so it can be used within other docs 0078 * 0079 * return Zend_Pdf_Page 0080 */ 0081 public function clonePage(Zend_Pdf_Page $page) 0082 { 0083 return $page->clonePage($this->_factory, $this->_processed); 0084 } 0085 } 0086