• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Pdf_Element类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __construct

 /**
  * Object constructor
  *
  * @param Zend_Pdf_Element $rootDictionary root of name dictionary
  */
 public function __construct(Zend_Pdf_Element $rootDictionary)
 {
     if ($rootDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Name tree root must be a dictionary.');
     }
     $intermediateNodes = array();
     $leafNodes = array();
     if ($rootDictionary->Kids !== null) {
         $intermediateNodes[] = $rootDictionary;
     } else {
         $leafNodes[] = $rootDictionary;
     }
     while (count($intermediateNodes) != 0) {
         $newIntermediateNodes = array();
         foreach ($intermediateNodes as $node) {
             foreach ($node->Kids->items as $childNode) {
                 if ($childNode->Kids !== null) {
                     $newIntermediateNodes[] = $childNode;
                 } else {
                     $leafNodes[] = $childNode;
                 }
             }
         }
         $intermediateNodes = $newIntermediateNodes;
     }
     foreach ($leafNodes as $leafNode) {
         $destinationsCount = count($leafNode->Names->items) / 2;
         for ($count = 0; $count < $destinationsCount; $count++) {
             $this->_items[$leafNode->Names->items[$count * 2]->value] = $leafNode->Names->items[$count * 2 + 1];
         }
     }
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:38,代码来源:NameTree.php


示例2: __construct

 /**
  * Explicit destination object constructor
  *
  * @param Zend_Pdf_Element $destinationArray
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $destinationArray)
 {
     if ($destinationArray->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Explicit destination resource Array must be a direct or an indirect array object.');
     }
     $this->_destinationArray = $destinationArray;
     switch (count($this->_destinationArray->items)) {
         case 0:
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Destination array must contain a page reference.');
             break;
         case 1:
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Destination array must contain a destination type name.');
             break;
         default:
             // Do nothing
             break;
     }
     switch ($this->_destinationArray->items[0]->getType()) {
         case Zend_Pdf_Element::TYPE_NUMERIC:
             $this->_isRemote = true;
             break;
         case Zend_Pdf_Element::TYPE_DICTIONARY:
             $this->_isRemote = false;
             break;
         default:
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Destination target must be a page number or page dictionary object.');
             break;
     }
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:39,代码来源:Explicit.php


示例3: load

 /**
  * Parse resource and return it as an Action or Explicit Destination
  *
  * $param Zend_Pdf_Element $resource
  * @return Zend_Pdf_Destination|
  * @throws Zend_Pdf_Exception
  */
 public static function load(Zend_Pdf_Element $resource)
 {
     require_once 'Zend/Pdf/Element.php';
     if ($resource->getType() == Zend_Pdf_Element::TYPE_DICTIONARY) {
         if (($resource->Type === null || $resource->Type->value == 'Action') && $resource->S !== null) {
             // It's a well-formed action, load it
             require_once 'Zend/Pdf/Action.php';
             return Zend_Pdf_Action::load($resource);
         } else {
             if ($resource->D !== null) {
                 // It's a destination
                 $resource = $resource->D;
             } else {
                 require_once 'Zend/Pdf/Exception.php';
                 throw new Zend_Pdf_Exception('Wrong resource type.');
             }
         }
     }
     if ($resource->getType() == Zend_Pdf_Element::TYPE_ARRAY || $resource->getType() == Zend_Pdf_Element::TYPE_NAME || $resource->getType() == Zend_Pdf_Element::TYPE_STRING) {
         // Resource is an array, just treat it as an explicit destination array
         require_once 'Zend/Pdf/Destination.php';
         return Zend_Pdf_Destination::load($resource);
     } else {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Wrong resource type.');
     }
 }
开发者ID:conectapb,项目名称:sysagroweb,代码行数:34,代码来源:Target.php


示例4: __construct

 /**
  * Named destination object constructor
  *
  * @param Zend_Pdf_Element $resource
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $resource)
 {
     if ($resource->getType() != Zend_Pdf_Element::TYPE_NAME && $resource->getType() != Zend_Pdf_Element::TYPE_STRING) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Named destination resource must be a PDF name or a PDF string.');
     }
     $this->_nameElement = $resource;
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:14,代码来源:Named.php


示例5: load

 /**
  * Load Destination object from a specified resource
  *
  * @internal
  * @param Zend_Pdf_Element $resource
  * @return Zend_Pdf_Destination
  */
 public static function load(Zend_Pdf_Element $resource)
 {
     require_once 'Zend/Pdf/Element.php';
     if ($resource->getType() == Zend_Pdf_Element::TYPE_NAME || $resource->getType() == Zend_Pdf_Element::TYPE_STRING) {
         require_once 'Zend/Pdf/Destination/Named.php';
         return new Zend_Pdf_Destination_Named($resource);
     }
     if ($resource->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('An explicit destination must be a direct or an indirect array object.');
     }
     if (count($resource->items) < 2) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('An explicit destination array must contain at least two elements.');
     }
     switch ($resource->items[1]->value) {
         case 'XYZ':
             require_once 'Zend/Pdf/Destination/Zoom.php';
             return new Zend_Pdf_Destination_Zoom($resource);
             break;
         case 'Fit':
             require_once 'Zend/Pdf/Destination/Fit.php';
             return new Zend_Pdf_Destination_Fit($resource);
             break;
         case 'FitH':
             require_once 'Zend/Pdf/Destination/FitHorizontally.php';
             return new Zend_Pdf_Destination_FitHorizontally($resource);
             break;
         case 'FitV':
             require_once 'Zend/Pdf/Destination/FitVertically.php';
             return new Zend_Pdf_Destination_FitVertically($resource);
             break;
         case 'FitR':
             require_once 'Zend/Pdf/Destination/FitRectangle.php';
             return new Zend_Pdf_Destination_FitRectangle($resource);
             break;
         case 'FitB':
             require_once 'Zend/Pdf/Destination/FitBoundingBox.php';
             return new Zend_Pdf_Destination_FitBoundingBox($resource);
             break;
         case 'FitBH':
             require_once 'Zend/Pdf/Destination/FitBoundingBoxHorizontally.php';
             return new Zend_Pdf_Destination_FitBoundingBoxHorizontally($resource);
             break;
         case 'FitBV':
             require_once 'Zend/Pdf/Destination/FitBoundingBoxVertically.php';
             return new Zend_Pdf_Destination_FitBoundingBoxVertically($resource);
             break;
         default:
             require_once 'Zend/Pdf/Destination/Unknown.php';
             return new Zend_Pdf_Destination_Unknown($resource);
             break;
     }
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:61,代码来源:Destination.php


示例6: __construct

 /**
  * Annotation object constructor
  *
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $annotationDictionary)
 {
     if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
     }
     if ($annotationDictionary->Subtype === null || $annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME || !in_array($annotationDictionary->Subtype->value, array(self::SUBTYPE_HIGHLIGHT, self::SUBTYPE_UNDERLINE, self::SUBTYPE_SQUIGGLY, self::SUBTYPE_STRIKEOUT))) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Subtype => Markup entry is omitted or has wrong value.');
     }
     parent::__construct($annotationDictionary);
 }
开发者ID:brianbui171,项目名称:website_zend_1.11,代码行数:17,代码来源:Markup.php


示例7: __construct

 /**
  * Annotation object constructor
  *
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $annotationDictionary)
 {
     if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         //$1 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
     }
     if ($annotationDictionary->Subtype === null || $annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME || $annotationDictionary->Subtype->value != 'Link') {
         //$1 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Subtype => Link entry is requires');
     }
     parent::__construct($annotationDictionary);
 }
开发者ID:netconstructor,项目名称:Centurion,代码行数:17,代码来源:Link.php


示例8: __construct

 /**
  * Annotation object constructor
  *
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $annotationDictionary)
 {
     if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         require_once PHP_LIBRARY_PATH . 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
     }
     if ($annotationDictionary->Subtype === null || $annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME || $annotationDictionary->Subtype->value != 'FileAttachment') {
         require_once PHP_LIBRARY_PATH . 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Subtype => FileAttachment entry is requires');
     }
     parent::__construct($annotationDictionary);
 }
开发者ID:netixx,项目名称:Stock,代码行数:17,代码来源:FileAttachment.php


示例9: load

 /**
  * Parse resource and return it as an Action or Explicit Destination
  *
  * $param Zend_Pdf_Element $resource
  * @return Zend_Pdf_Destination|
  * @throws Zend_Pdf_Exception
  */
 public static function load(Zend_Pdf_Element $resource)
 {
     if ($resource->getType() == Zend_Pdf_Element::TYPE_DICTIONARY) {
         // Load destination as appropriate action
         return Zend_Pdf_Action::load($resource);
     } else {
         if ($resource->getType() == Zend_Pdf_Element::TYPE_ARRAY || $resource->getType() == Zend_Pdf_Element::TYPE_NAME || $resource->getType() == Zend_Pdf_Element::TYPE_STRING) {
             // Resource is an array, just treat it as an explicit destination array
             return Zend_Pdf_Destination::load($resource);
         } else {
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Wrong resource type.');
         }
     }
 }
开发者ID:jingjangjung,项目名称:Storefront,代码行数:22,代码来源:Target.php


示例10: __construct

 /**
  * Object constructor.
  *
  * If resource is not a Zend_Pdf_Element object, then stream object with specified value is
  * generated.
  *
  * @param Zend_Pdf_Element|string $resource
  */
 public function __construct($resource)
 {
     if ($resource instanceof Zend_Pdf_Element_Object) {
         $this->_objectFactory = $resource->getFactory();
         $this->_resource = $resource;
         return;
     }
     require_once 'Zend/Pdf/ElementFactory.php';
     $this->_objectFactory = Zend_Pdf_ElementFactory::createFactory(1);
     if ($resource instanceof Zend_Pdf_Element) {
         $this->_resource = $this->_objectFactory->newObject($resource);
     } else {
         $this->_resource = $this->_objectFactory->newStreamObject($resource);
     }
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:23,代码来源:Resource.php


示例11: phpToPdf

 /**
  * Convert PHP value into PDF element.
  *
  * @param mixed $input
  * @return Zend_Pdf_Element
  */
 public static function phpToPdf($input)
 {
     if (is_numeric($input)) {
         //require_once 'Zend/Pdf/Element/Numeric.php';
         return new Zend_Pdf_Element_Numeric($input);
     } else {
         if (is_bool($input)) {
             //require_once 'Zend/Pdf/Element/Boolean.php';
             return new Zend_Pdf_Element_Boolean($input);
         } else {
             if (is_array($input)) {
                 $pdfElementsArray = array();
                 $isDictionary = false;
                 foreach ($input as $key => $value) {
                     if (is_string($key)) {
                         $isDictionary = true;
                     }
                     $pdfElementsArray[$key] = Zend_Pdf_Element::phpToPdf($value);
                 }
                 if ($isDictionary) {
                     //require_once 'Zend/Pdf/Element/Dictionary.php';
                     return new Zend_Pdf_Element_Dictionary($pdfElementsArray);
                 } else {
                     //require_once 'Zend/Pdf/Element/Array.php';
                     return new Zend_Pdf_Element_Array($pdfElementsArray);
                 }
             } else {
                 //require_once 'Zend/Pdf/Element/String.php';
                 return new Zend_Pdf_Element_String((string) $input);
             }
         }
     }
 }
开发者ID:chaimvaid,项目名称:linet3,代码行数:39,代码来源:Element.php


示例12: load

 /**
  * Load PDF action object using specified dictionary
  *
  * @internal
  * @param Zend_Pdf_Element $dictionary (It's actually Dictionary or Dictionary Object or Reference to a Dictionary Object)
  * @param SplObjectStorage $processedActions  list of already processed action dictionaries, used to avoid cyclic references
  * @return Zend_Pdf_Action
  * @throws Zend_Pdf_Exception
  */
 public static function load(Zend_Pdf_Element $dictionary, SplObjectStorage $processedActions = null)
 {
     if ($processedActions === null) {
         $processedActions = new SplObjectStorage();
     }
     require_once 'Zend/Pdf/Element.php';
     if ($dictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('$dictionary mast be a direct or an indirect dictionary object.');
     }
     if (isset($dictionary->Type) && $dictionary->Type->value != 'Action') {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Action dictionary Type entry must be set to \'Action\'.');
     }
     if ($dictionary->S === null) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Action dictionary must contain S entry');
     }
     switch ($dictionary->S->value) {
         case 'GoTo':
             require_once 'Zend/Pdf/Action/GoTo.php';
             return new Zend_Pdf_Action_GoTo($dictionary, $processedActions);
             brake;
         case 'GoToR':
             require_once 'Zend/Pdf/Action/GoToR.php';
             return new Zend_Pdf_Action_GoToR($dictionary, $processedActions);
             brake;
         case 'GoToE':
             require_once 'Zend/Pdf/Action/GoToE.php';
             return new Zend_Pdf_Action_GoToE($dictionary, $processedActions);
             brake;
         case 'Launch':
             require_once 'Zend/Pdf/Action/Launch.php';
             return new Zend_Pdf_Action_Launch($dictionary, $processedActions);
             brake;
         case 'Thread':
             require_once 'Zend/Pdf/Action/Thread.php';
             return new Zend_Pdf_Action_Thread($dictionary, $processedActions);
             brake;
         case 'URI':
             require_once 'Zend/Pdf/Action/URI.php';
             return new Zend_Pdf_Action_URI($dictionary, $processedActions);
             brake;
         case 'Sound':
             require_once 'Zend/Pdf/Action/Sound.php';
             return new Zend_Pdf_Action_Sound($dictionary, $processedActions);
             brake;
         case 'Movie':
             require_once 'Zend/Pdf/Action/Movie.php';
             return new Zend_Pdf_Action_Movie($dictionary, $processedActions);
             brake;
         case 'Hide':
             require_once 'Zend/Pdf/Action/Hide.php';
             return new Zend_Pdf_Action_Hide($dictionary, $processedActions);
             brake;
         case 'Named':
             require_once 'Zend/Pdf/Action/Named.php';
             return new Zend_Pdf_Action_Named($dictionary, $processedActions);
             brake;
         case 'SubmitForm':
             require_once 'Zend/Pdf/Action/SubmitForm.php';
             return new Zend_Pdf_Action_SubmitForm($dictionary, $processedActions);
             brake;
         case 'ResetForm':
             require_once 'Zend/Pdf/Action/ResetForm.php';
             return new Zend_Pdf_Action_ResetForm($dictionary, $processedActions);
             brake;
         case 'ImportData':
             require_once 'Zend/Pdf/Action/ImportData.php';
             return new Zend_Pdf_Action_ImportData($dictionary, $processedActions);
             brake;
         case 'JavaScript':
             require_once 'Zend/Pdf/Action/JavaScript.php';
             return new Zend_Pdf_Action_JavaScript($dictionary, $processedActions);
             brake;
         case 'SetOCGState':
             require_once 'Zend/Pdf/Action/SetOCGState.php';
             return new Zend_Pdf_Action_SetOCGState($dictionary, $processedActions);
             brake;
         case 'Rendition':
             require_once 'Zend/Pdf/Action/Rendition.php';
             return new Zend_Pdf_Action_Rendition($dictionary, $processedActions);
             brake;
         case 'Trans':
             require_once 'Zend/Pdf/Action/Trans.php';
             return new Zend_Pdf_Action_Trans($dictionary, $processedActions);
             brake;
         case 'GoTo3DView':
             require_once 'Zend/Pdf/Action/GoTo3DView.php';
             return new Zend_Pdf_Action_GoTo3DView($dictionary, $processedActions);
             brake;
//.........这里部分代码省略.........
开发者ID:kokx,项目名称:zf-library,代码行数:101,代码来源:Action.php


示例13: __construct

 /**
  * Annotation object constructor
  *
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $annotationDictionary)
 {
     if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
     }
     $this->_annotationDictionary = $annotationDictionary;
     if ($this->_annotationDictionary->Type !== null && $this->_annotationDictionary->Type->value != 'Annot') {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('Wrong resource type. \'Annot\' expected.');
     }
     if ($this->_annotationDictionary->Rect === null) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('\'Rect\' dictionary entry is required.');
     }
     if (count($this->_annotationDictionary->Rect->items) != 4 || $this->_annotationDictionary->Rect->items[0]->getType() != Zend_Pdf_Element::TYPE_NUMERIC || $this->_annotationDictionary->Rect->items[1]->getType() != Zend_Pdf_Element::TYPE_NUMERIC || $this->_annotationDictionary->Rect->items[2]->getType() != Zend_Pdf_Element::TYPE_NUMERIC || $this->_annotationDictionary->Rect->items[3]->getType() != Zend_Pdf_Element::TYPE_NUMERIC) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('\'Rect\' dictionary entry must be an array of four numeric elements.');
     }
 }
开发者ID:andrelsguerra,项目名称:pequiambiental,代码行数:25,代码来源:Annotation.php


示例14: setParentObject

 /**
  * Set top level parent indirect object.
  *
  * @param Zend_Pdf_Element_Object $parent
  */
 public function setParentObject(Zend_Pdf_Element_Object $parent)
 {
     parent::setParentObject($parent);
     foreach ($this->items as $item) {
         $item->setParentObject($parent);
     }
 }
开发者ID:JaroslavRamba,项目名称:ex-facebook-bundle,代码行数:12,代码来源:Array.php


示例15: render

    /**
     * Render the completed PDF to a string.
     * If $newSegmentOnly is true and it's not a new document,
     * then only appended part of PDF is returned.
     *
     * @param boolean $newSegmentOnly
     * @param resource $outputStream
     * @return string
     * @throws Zend_Pdf_Exception
     */
    public function render($newSegmentOnly = false, $outputStream = null)
    {
        if ($this->_isNewDocument) {
            // Drop full document first time even $newSegmentOnly is set to true
            $newSegmentOnly = false;
            $this->_isNewDocument = false;
        }

        // Save document properties if necessary
        if ($this->properties != $this->_originalProperties) {
            $docInfo = $this->_objFactory->newObject(new Zend_Pdf_Element_Dictionary());

            foreach ($this->properties as $key => $value) {
                switch ($key) {
                    case 'Trapped':
                        switch ($value) {
                            case true:
                                $docInfo->$key = new Zend_Pdf_Element_Name('True');
                                break;

                            case false:
                                $docInfo->$key = new Zend_Pdf_Element_Name('False');
                                break;

                            case null:
                                $docInfo->$key = new Zend_Pdf_Element_Name('Unknown');
                                break;

                            default:
                                require_once 'Zend/Pdf/Exception.php';
                                throw new Zend_Pdf_Exception('Wrong Trapped document property vale: \'' . $value . '\'. Only true, false and null values are allowed.');
                                break;
                        }

                    case 'CreationDate':
                        // break intentionally omitted
                    case 'ModDate':
                        $docInfo->$key = new Zend_Pdf_Element_String((string)$value);
                        break;

                    case 'Title':
                        // break intentionally omitted
                    case 'Author':
                        // break intentionally omitted
                    case 'Subject':
                        // break intentionally omitted
                    case 'Keywords':
                        // break intentionally omitted
                    case 'Creator':
                        // break intentionally omitted
                    case 'Producer':
                        if (extension_loaded('mbstring') === true) {
                            $detected = mb_detect_encoding($value);
                            if ($detected !== 'ASCII') {
                                $value = "\xfe\xff" . mb_convert_encoding($value, 'UTF-16', $detected);
                            }
                        }
                        $docInfo->$key = new Zend_Pdf_Element_String((string)$value);
                        break;

                    default:
                        // Set property using PDF type based on PHP type
                        $docInfo->$key = Zend_Pdf_Element::phpToPdf($value);
                        break;
                }
            }

            $this->_trailer->Info = $docInfo;
        }

        $this->_dumpPages();
        $this->_dumpNamedDestinations();
        $this->_dumpOutlines();

        // Check, that PDF file was modified
        // File is always modified by _dumpPages() now, but future implementations may eliminate this.
        if (!$this->_objFactory->isModified()) {
            if ($newSegmentOnly) {
                // Do nothing, return
                return '';
            }

            if ($outputStream === null) {
                return $this->_trailer->getPDFString();
            } else {
                $pdfData = $this->_trailer->getPDFString();
                while ( strlen($pdfData) > 0 && ($byteCount = fwrite($outputStream, $pdfData)) != false ) {
                    $pdfData = substr($pdfData, $byteCount);
                }

//.........这里部分代码省略.........
开发者ID:nhp,项目名称:shopware-4,代码行数:101,代码来源:Pdf.php


示例16: __construct

 /**
  * Create PDF outline object using specified dictionary
  *
  * @internal
  * @param Zend_Pdf_Element $dictionary (It's actually Dictionary or Dictionary Object or Reference to a Dictionary Object)
  * @param Zend_Pdf_Action  $parentAction
  * @param SplObjectStorage $processedOutlines  List of already processed Outline dictionaries,
  *                                             used to avoid cyclic references
  * @return Zend_Pdf_Action
  * @throws Zend_Pdf_Exception
  */
 public function __construct(Zend_Pdf_Element $dictionary, SplObjectStorage $processedDictionaries = null)
 {
     if ($dictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
         require_once 'Zend/Pdf/Exception.php';
         throw new Zend_Pdf_Exception('$dictionary mast be an indirect dictionary object.');
     }
     if ($processedDictionaries === null) {
         $processedDictionaries = new SplObjectStorage();
     }
     $processedDictionaries->attach($dictionary);
     $this->_outlineDictionary = $dictionary;
     if ($dictionary->Count !== null) {
         if ($dictionary->Count->getType() != Zend_Pdf_Element::TYPE_NUMERIC) {
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception('Outline dictionary Count entry must be a numeric element.');
         }
         $childOutlinesCount = $dictionary->Count->value;
         if ($childOutlinesCount > 0) {
             $this->_open = true;
         }
         $childOutlinesCount = abs($childOutlinesCount);
         $childDictionary = $dictionary->First;
         $children = new SplObjectStorage();
         while ($childDictionary !== null) {
             // Check children structure for cyclic references
             if ($children->contains($childDictionary)) {
                 require_once 'Zend/Pdf/Exception.php';
                 throw new Zend_Pdf_Exception('Outline childs load error.');
             }
             if (!$processedDictionaries->contains($childDictionary)) {
                 $this->childOutlines[] = new Zend_Pdf_Outline_Loaded($childDictionary, $processedDictionaries);
             }
             $childDictionary = $childDictionary->Next;
         }
         $this->_originalChildOutlines = $this->childOutlines;
     }
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:48,代码来源:Loaded.php


示例17: dump

 /**
  * Dump object to a string to save within PDF file.
  *
  * $factory parameter defines operation context.
  *
  * @param Zend_Pdf_ElementFactory $factory
  * @return string
  */
 public function dump(Zend_Pdf_ElementFactory $factory)
 {
     $shift = $factory->getEnumerationShift($this->_factory);
     return $this->_objNum + $shift . " " . $this->_genNum . " obj \n" . $this->_value->toString($factory) . "\n" . "endobj\n";
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:13,代码来源:Object.php


示例18: toPhp

 /**
  * Convert PDF element to PHP type.
  *
  * @return mixed
  */
 public function toPhp()
 {
     return $this->_value->toPhp();
 }
开发者ID:fredcido,项目名称:cenbrap,代码行数:9,代码来源:Object.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Pdf_ElementFactory类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Pdf_Destination_Named类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap