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


PHP Zend_Pdf_Element_Name::unescape方法代码示例

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


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

示例1: testUnescape

 public function testUnescape()
 {
     $this->assertEquals(Zend_Pdf_Element_Name::unescape('My#20Cool#20Name#28#29'), 'My Cool Name()');
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:4,代码来源:NameTest.php

示例2: readElement

 /**
  * Read elemental object from a PDF stream
  *
  * @return Zend_Pdf_Element
  * @throws Zend_Pdf_Exception
  */
 public function readElement($nextLexeme = null)
 {
     if ($nextLexeme === null) {
         $nextLexeme = $this->readLexeme();
     }
     /**
      * Note: readElement() method is a public method and could be invoked from other classes.
      * If readElement() is used not by Zend_Pdf_StringParser::getObject() method, then we should not care
      * about _elements member management.
      */
     switch ($nextLexeme) {
         case '(':
             return $this->_elements[] = $this->_readString();
         case '<':
             return $this->_elements[] = $this->_readBinaryString();
         case '/':
             return $this->_elements[] = new Zend_Pdf_Element_Name(Zend_Pdf_Element_Name::unescape($this->readLexeme()));
         case '[':
             return $this->_elements[] = $this->_readArray();
         case '<<':
             return $this->_elements[] = $this->_readDictionary();
         case ')':
             // fall through to next case
         // fall through to next case
         case '>':
             // fall through to next case
         // fall through to next case
         case ']':
             // fall through to next case
         // fall through to next case
         case '>>':
             // fall through to next case
         // fall through to next case
         case '{':
             // fall through to next case
         // fall through to next case
         case '}':
             require_once 'Zend/Pdf/Exception.php';
             throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X.', $this->offset));
         default:
             if (strcasecmp($nextLexeme, 'true') == 0) {
                 return $this->_elements[] = new Zend_Pdf_Element_Boolean(true);
             } else {
                 if (strcasecmp($nextLexeme, 'false') == 0) {
                     return $this->_elements[] = new Zend_Pdf_Element_Boolean(false);
                 } else {
                     if (strcasecmp($nextLexeme, 'null') == 0) {
                         return $this->_elements[] = new Zend_Pdf_Element_Null();
                     }
                 }
             }
             $ref = $this->_readReference($nextLexeme);
             if ($ref !== null) {
                 return $this->_elements[] = $ref;
             }
             return $this->_elements[] = $this->_readNumeric($nextLexeme);
     }
 }
开发者ID:travisj,项目名称:zf,代码行数:64,代码来源:StringParser.php

示例3: _readElementalObject

 /**
  * Read elemental object from a PDF stream
  *
  * @return Zend_Pdf_Element
  * @throws Zend_Pdf_Exception
  */
 private function _readElementalObject($nextLexeme = null)
 {
     if ($nextLexeme === null) {
         $nextLexeme = $this->_readLexeme();
     }
     switch ($nextLexeme) {
         case '(':
             return $this->_elements[] = $this->_readString();
         case '<':
             return $this->_elements[] = $this->_readBinaryString();
         case '/':
             return $this->_elements[] = new Zend_Pdf_Element_Name(Zend_Pdf_Element_Name::unescape($this->_readLexeme()));
         case '[':
             return $this->_elements[] = $this->_readArray();
         case '<<':
             return $this->_elements[] = $this->_readDictionary();
         case ')':
             // fall through to next case
         // fall through to next case
         case '>':
             // fall through to next case
         // fall through to next case
         case ']':
             // fall through to next case
         // fall through to next case
         case '>>':
             // fall through to next case
         // fall through to next case
         case '{':
             // fall through to next case
         // fall through to next case
         case '}':
             throw new Zend_Pdf_Exception(sprintf('PDF file syntax error. Offset - 0x%X.', $this->_current));
         default:
             if (strcasecmp($nextLexeme, 'true') == 0) {
                 return $this->_elements[] = new Zend_Pdf_Element_Boolean(true);
             } else {
                 if (strcasecmp($nextLexeme, 'false') == 0) {
                     return $this->_elements[] = new Zend_Pdf_Element_Boolean(false);
                 } else {
                     if (strcasecmp($nextLexeme, 'null') == 0) {
                         return $this->_elements[] = new Zend_Pdf_Element_Null();
                     }
                 }
             }
             $ref = $this->_readReference($nextLexeme);
             if ($ref !== null) {
                 return $this->_elements[] = $ref;
             }
             return $this->_elements[] = $this->_readNumeric($nextLexeme);
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:58,代码来源:Parser.php


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