Beispiel #1
0
 public function testUnescape2()
 {
     $this->assertEquals(InternalType\BinaryStringObject::unescape('01020304FF2'), "ÿ ");
 }
Beispiel #2
0
 /**
  * Read binary string PDF object
  * Also reads trailing '>' from a pdf stream
  *
  * @return \Zend\Pdf\InternalType\BinaryStringObject
  * @throws \Zend\Pdf\Exception
  */
 private function _readBinaryString()
 {
     $start = $this->offset;
     $this->offset += strspn($this->data, "\t\n\f\r 0123456789abcdefABCDEF", $this->offset);
     if ($this->offset >= strlen($this->data) - 1) {
         throw new Pdf\Exception(sprintf('PDF file syntax error. Unexpected end of file while reading binary string. Offset - 0x%X. \'>\' expected.', $start));
     }
     if ($this->data[$this->offset++] != '>') {
         throw new Pdf\Exception(sprintf('PDF file syntax error. Unexpected character while binary string reading. Offset - 0x%X.', $this->offset));
     }
     return new InternalType\BinaryStringObject(InternalType\BinaryStringObject::unescape(substr($this->data, $start, $this->offset - $start - 1)));
 }
 public function testUnescape2()
 {
     $this->assertEquals(InternalType\BinaryStringObject::unescape('01020304FF2'), "\x01\x02\x03\x04\xFF ");
 }