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


PHP Zend_Pdf::pdfDate方法代码示例

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


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

示例1: __construct


//.........这里部分代码省略.........
         if ($param1 instanceof Zend_Pdf_Page && $param2 === null && $param3 === null) {
             // Clone existing page.
             // Let already existing content and resources to be shared between pages
             // We don't give existing content modification functionality, so we don't need "deep copy"
             $this->_objFactory = $param1->_objFactory;
             $this->_attached =& $param1->_attached;
             $this->_safeGS = false;
             $this->_pageDictionary = $this->_objFactory->newObject(new Zend_Pdf_Element_Dictionary());
             foreach ($param1->_pageDictionary->getKeys() as $key) {
                 if ($key == 'Contents') {
                     // Clone Contents property
                     $this->_pageDictionary->Contents = new Zend_Pdf_Element_Array();
                     if ($param1->_pageDictionary->Contents->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
                         // Prepare array of content streams and add existing stream
                         $this->_pageDictionary->Contents->items[] = $param1->_pageDictionary->Contents;
                     } else {
                         // Clone array of the content streams
                         foreach ($param1->_pageDictionary->Contents->items as $srcContentStream) {
                             $this->_pageDictionary->Contents->items[] = $srcContentStream;
                         }
                     }
                 } else {
                     $this->_pageDictionary->{$key} = $param1->_pageDictionary->{$key};
                 }
             }
             return;
         } else {
             if (is_string($param1) && ($param2 === null || $param2 instanceof Zend_Pdf_ElementFactory_Interface) && $param3 === null) {
                 if ($param2 !== null) {
                     $this->_objFactory = $param2;
                 } else {
                     //require_once 'Zend/Pdf/ElementFactory.php';
                     $this->_objFactory = Zend_Pdf_ElementFactory::createFactory(1);
                 }
                 $this->_attached = false;
                 $this->_safeGS = true;
                 /** New page created. That's users App responsibility to track GS changes */
                 switch (strtolower($param1)) {
                     case 'a4':
                         $param1 = Zend_Pdf_Page::SIZE_A4;
                         break;
                     case 'a4-landscape':
                         $param1 = Zend_Pdf_Page::SIZE_A4_LANDSCAPE;
                         break;
                     case 'letter':
                         $param1 = Zend_Pdf_Page::SIZE_LETTER;
                         break;
                     case 'letter-landscape':
                         $param1 = Zend_Pdf_Page::SIZE_LETTER_LANDSCAPE;
                         break;
                     default:
                         // should be in "x:y" or "x:y:" form
                 }
                 $pageDim = explode(':', $param1);
                 if (count($pageDim) == 2 || count($pageDim) == 3) {
                     $pageWidth = $pageDim[0];
                     $pageHeight = $pageDim[1];
                 } else {
                     /**
                      * @todo support of user defined pagesize notations, like:
                      *       "210x297mm", "595x842", "8.5x11in", "612x792"
                      */
                     //require_once 'Zend/Pdf/Exception.php';
                     throw new Zend_Pdf_Exception('Wrong pagesize notation.');
                 }
                 /**
                  * @todo support of pagesize recalculation to "default user space units"
                  */
             } else {
                 if (is_numeric($param1) && is_numeric($param2) && ($param3 === null || $param3 instanceof Zend_Pdf_ElementFactory_Interface)) {
                     if ($param3 !== null) {
                         $this->_objFactory = $param3;
                     } else {
                         //require_once 'Zend/Pdf/ElementFactory.php';
                         $this->_objFactory = Zend_Pdf_ElementFactory::createFactory(1);
                     }
                     $this->_attached = false;
                     $this->_safeGS = true;
                     /** New page created. That's users App responsibility to track GS changes */
                     $pageWidth = $param1;
                     $pageHeight = $param2;
                 } else {
                     //require_once 'Zend/Pdf/Exception.php';
                     throw new Zend_Pdf_Exception('Unrecognized method signature, wrong number of arguments or wrong argument types.');
                 }
             }
         }
     }
     $this->_pageDictionary = $this->_objFactory->newObject(new Zend_Pdf_Element_Dictionary());
     $this->_pageDictionary->Type = new Zend_Pdf_Element_Name('Page');
     //require_once 'Zend/Pdf.php';
     $this->_pageDictionary->LastModified = new Zend_Pdf_Element_String(Zend_Pdf::pdfDate());
     $this->_pageDictionary->Resources = new Zend_Pdf_Element_Dictionary();
     $this->_pageDictionary->MediaBox = new Zend_Pdf_Element_Array();
     $this->_pageDictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric(0);
     $this->_pageDictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric(0);
     $this->_pageDictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric($pageWidth);
     $this->_pageDictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric($pageHeight);
     $this->_pageDictionary->Contents = new Zend_Pdf_Element_Array();
 }
开发者ID:chaimvaid,项目名称:linet3,代码行数:101,代码来源:Page.php

示例2: __construct

 public function __construct($source = null, $revision = null, $load = false)
 {
     parent::__construct($source, $revision, $load);
     $this->_currentTime = Zend_Pdf::pdfDate();
 }
开发者ID:hkhateb,项目名称:linet3,代码行数:5,代码来源:Pdf.php

示例3: __construct

 /**
  * Object constructor.
  * Constructor signatures:
  *
  * 1. Load PDF page from a parsed PDF file.
  *    Object factory is created by PDF parser.
  * ---------------------------------------------------------
  * new Zend_Pdf_Page(Zend_Pdf_Element_Dictionary       $pageDict,
  *                   Zend_Pdf_ElementFactory_Interface $factory);
  * ---------------------------------------------------------
  *
  * 2. Clone PDF page.
  *    New page is created in the same context as source page. Object factory is shared.
  *    Thus it will be attached to the document, but need to be placed into Zend_Pdf::$pages array
  *    to be included into output.
  * ---------------------------------------------------------
  * new Zend_Pdf_Page(Zend_Pdf_Page $page);
  * ---------------------------------------------------------
  *
  * 3. Create new page with a specified pagesize.
  *    If $factory is null then it will be created and page must be attached to the document to be
  *    included into output.
  * ---------------------------------------------------------
  * new Zend_Pdf_Page(string $pagesize, Zend_Pdf_ElementFactory_Interface $factory = null);
  * ---------------------------------------------------------
  *
  * 4. Create new page with a specified pagesize (in default user space units).
  *    If $factory is null then it will be created and page must be attached to the document to be
  *    included into output.
  * ---------------------------------------------------------
  * new Zend_Pdf_Page(numeric $width, numeric $height, Zend_Pdf_ElementFactory_Interface $factory = null);
  * ---------------------------------------------------------
  *
  *
  * @param mixed $param1
  * @param mixed $param2
  * @param mixed $param3
  * @throws Zend_Pdf_Exception
  */
 public function __construct($param1, $param2 = null, $param3 = null)
 {
     if ($param1 instanceof Zend_Pdf_Element_Reference && $param1->getType() == Zend_Pdf_Element::TYPE_DICTIONARY && $param2 instanceof Zend_Pdf_ElementFactory_Interface && $param3 === null) {
         $this->_pageDictionary = $param1;
         $this->_objFactory = $param2;
         $this->_attached = true;
         return;
     } else {
         if ($param1 instanceof Zend_Pdf_Page && $param2 === null && $param3 === null) {
             /** @todo implementation */
             throw new Zend_Pdf_Exception('Not implemented yet.');
         } else {
             if (is_string($param1) && ($param2 === null || $param2 instanceof Zend_Pdf_ElementFactory_Interface) && $param3 === null) {
                 $this->_objFactory = $param2 !== null ? $param2 : Zend_Pdf_ElementFactory::createFactory(1);
                 $this->_attached = false;
                 switch (strtolower($param1)) {
                     case 'a4':
                         $param1 = Zend_Pdf_Page::SIZE_A4;
                         break;
                     case 'a4-landscape':
                         $param1 = Zend_Pdf_Page::SIZE_A4_LANDSCAPE;
                         break;
                     case 'letter':
                         $param1 = Zend_Pdf_Page::SIZE_LETTER;
                         break;
                     case 'letter-landscape':
                         $param1 = Zend_Pdf_Page::SIZE_LETTER_LANDSCAPE;
                         break;
                     default:
                         // should be in "x:y" form
                 }
                 $pageDim = explode(':', $param1);
                 if (count($pageDim) == 3) {
                     $pageWidth = $pageDim[0];
                     $pageHeight = $pageDim[1];
                 } else {
                     /**
                      * @todo support of user defined pagesize notations, like:
                      *       "210x297mm", "595x842", "8.5x11in", "612x792"
                      */
                     throw new Zend_Pdf_Exception('Wrong pagesize notation.');
                 }
                 /**
                  * @todo support of pagesize recalculation to "default user space units"
                  */
             } else {
                 if (is_numeric($param1) && is_numeric($param2) && ($param3 === null || $param3 instanceof Zend_Pdf_ElementFactory_Interface)) {
                     $this->_objFactory = $param3 !== null ? $param3 : Zend_Pdf_ElementFactory::createFactory(1);
                     $this->_attached = false;
                     $pageWidth = $param1;
                     $pageHeight = $param2;
                 } else {
                     throw new Zend_Pdf_Exception('Unrecognized method signature, wrong number of arguments or wrong argument types.');
                 }
             }
         }
     }
     $this->_pageDictionary = $this->_objFactory->newObject(new Zend_Pdf_Element_Dictionary());
     $this->_pageDictionary->Type = new Zend_Pdf_Element_Name('Page');
     $this->_pageDictionary->LastModified = new Zend_Pdf_Element_String(Zend_Pdf::pdfDate());
     $this->_pageDictionary->Resources = new Zend_Pdf_Element_Dictionary();
//.........这里部分代码省略.........
开发者ID:vojtajina,项目名称:sitellite,代码行数:101,代码来源:Page.php

示例4: __construct

 public function __construct($param1, $param2 = null, $param3 = null)
 {
     if (($param1 instanceof Zend_Pdf_Element_Reference || $param1 instanceof Zend_Pdf_Element_Object) && $param2 instanceof Zend_Pdf_ElementFactory_Interface && $param3 === null) {
         switch ($param1->getType()) {
             case Zend_Pdf_Element::TYPE_DICTIONARY:
                 $this->_dictionary = $param1;
                 $this->_objFactory = $param2;
                 $this->_attached = true;
                 $this->_safeGS = false;
                 return;
                 break;
             case Zend_Pdf_Element::TYPE_NULL:
                 $this->_objFactory = $param2;
                 $pageWidth = $pageHeight = 0;
                 break;
             default:
                 throw new Zend_Pdf_Exception('Unrecognized object type.');
                 break;
         }
     } else {
         if ($param1 instanceof Zend_Pdf_Page && $param2 === null && $param3 === null) {
             $this->_objFactory = $param1->_objFactory;
             $this->_attached =& $param1->_attached;
             $this->_safeGS = false;
             $this->_dictionary = $this->_objFactory->newObject(new Zend_Pdf_Element_Dictionary());
             foreach ($param1->_dictionary->getKeys() as $key) {
                 if ($key == 'Contents') {
                     $this->_dictionary->Contents = new Zend_Pdf_Element_Array();
                     if ($param1->_dictionary->Contents->getType() != Zend_Pdf_Element::TYPE_ARRAY) {
                         $this->_dictionary->Contents->items[] = $param1->_dictionary->Contents;
                     } else {
                         foreach ($param1->_dictionary->Contents->items as $srcContentStream) {
                             $this->_dictionary->Contents->items[] = $srcContentStream;
                         }
                     }
                 } else {
                     $this->_dictionary->{$key} = $param1->_dictionary->{$key};
                 }
             }
             return;
         } else {
             if (is_string($param1) && ($param2 === null || $param2 instanceof Zend_Pdf_ElementFactory_Interface) && $param3 === null) {
                 if ($param2 !== null) {
                     $this->_objFactory = $param2;
                 } else {
                     $this->_objFactory = Zend_Pdf_ElementFactory::createFactory(1);
                 }
                 $this->_attached = false;
                 $this->_safeGS = true;
                 switch (strtolower($param1)) {
                     case 'a4':
                         $param1 = Zend_Pdf_Page::SIZE_A4;
                         break;
                     case 'a4-landscape':
                         $param1 = Zend_Pdf_Page::SIZE_A4_LANDSCAPE;
                         break;
                     case 'letter':
                         $param1 = Zend_Pdf_Page::SIZE_LETTER;
                         break;
                     case 'letter-landscape':
                         $param1 = Zend_Pdf_Page::SIZE_LETTER_LANDSCAPE;
                         break;
                     default:
                 }
                 $pageDim = explode(':', $param1);
                 if (count($pageDim) == 2 || count($pageDim) == 3) {
                     $pageWidth = $pageDim[0];
                     $pageHeight = $pageDim[1];
                 } else {
                     throw new Zend_Pdf_Exception('Wrong pagesize notation.');
                 }
             } else {
                 if (is_numeric($param1) && is_numeric($param2) && ($param3 === null || $param3 instanceof Zend_Pdf_ElementFactory_Interface)) {
                     if ($param3 !== null) {
                         $this->_objFactory = $param3;
                     } else {
                         $this->_objFactory = Zend_Pdf_ElementFactory::createFactory(1);
                     }
                     $this->_attached = false;
                     $this->_safeGS = true;
                     $pageWidth = $param1;
                     $pageHeight = $param2;
                 } else {
                     throw new Zend_Pdf_Exception('Unrecognized method signature, wrong number of arguments or wrong argument types.');
                 }
             }
         }
     }
     $this->_dictionary = $this->_objFactory->newObject(new Zend_Pdf_Element_Dictionary());
     $this->_dictionary->Type = new Zend_Pdf_Element_Name('Page');
     $this->_dictionary->LastModified = new Zend_Pdf_Element_String(Zend_Pdf::pdfDate());
     $this->_dictionary->Resources = new Zend_Pdf_Element_Dictionary();
     $this->_dictionary->MediaBox = new Zend_Pdf_Element_Array();
     $this->_dictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric(0);
     $this->_dictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric(0);
     $this->_dictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric($pageWidth);
     $this->_dictionary->MediaBox->items[] = new Zend_Pdf_Element_Numeric($pageHeight);
     $this->_dictionary->Contents = new Zend_Pdf_Element_Array();
 }
开发者ID:subashemphasize,项目名称:test_site,代码行数:99,代码来源:Pdf_Pack.php


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