예제 #1
0
 /**
  * Writes the trailer.
  */
 private function writeTrailer()
 {
     $this->objectWriter->ensureBlankLine();
     $this->objectWriter->writeRawLine('trailer');
     $this->objectWriter->startDictionary();
     $this->objectWriter->writeName('Id');
     $this->objectWriter->startArray();
     $this->objectWriter->writeHexadecimalString($this->permanentFileIdentifier);
     $this->objectWriter->writeHexadecimalString($this->changingFileIdentifier);
     $this->objectWriter->endArray();
     if (null !== $this->encryption) {
         $this->objectWriter->writeName('Encrypt');
         $this->encryption->writeEncryptDictionary($this->objectWriter);
     }
     $this->objectWriter->endDictionary();
 }
예제 #2
0
 public function testEndDictionary()
 {
     $this->objectWriter->endDictionary();
     $this->assertSame('>>', $this->getFileObjectData());
 }
예제 #3
0
 /**
  * Writes the page contents and definition to the writer.
  *
  * @param  ObjectWriter $objectWriter
  * @param  int          $pageTreeId
  * @return int
  */
 public function writePage(ObjectWriter $objectWriter, $pageTreeId)
 {
     $objectWriter->startObject($this->pageId);
     $objectWriter->startDictionary();
     $objectWriter->writeName('Type');
     $objectWriter->writeName('Page');
     $objectWriter->writeName('Parent');
     $objectWriter->writeIndirectReference($pageTreeId);
     $objectWriter->writeName('Resources');
     $objectWriter->startDictionary();
     $objectWriter->endDictionary();
     $objectWriter->writeName('Contents');
     $objectWriter->startArray();
     $objectWriter->endArray();
     foreach ($this->boxes as $name => $box) {
         $objectWriter->writeName($name);
         $box->writeRectangleArray($objectWriter);
     }
     if (null !== $this->rotation) {
         $objectWriter->writeName('Rotate');
         $objectWriter->writeNumber($this->rotation);
     }
     $objectWriter->endDictionary();
     $objectWriter->endObject();
     return $this->pageId;
 }
예제 #4
0
 /**
  * Writes the info dictionary.
  *
  * @param ObjectWriter $objectWriter
  * @internal
  */
 public function writeInfoDictionary(ObjectWriter $objectWriter)
 {
     $objectWriter->startDictionary();
     foreach ($this->data as $key => $value) {
         $objectWriter->writeName($key);
         switch ($key) {
             case 'CreationDate':
             case 'ModDate':
                 $objectWriter->writeLiteralString(StringUtils::formatDateTime($value));
                 break;
             case 'Trapped':
                 $objectWriter->writeName($value);
                 break;
             default:
                 $objectWriter->writeLiteralString(StringUtils::encodeString($value));
         }
     }
     $objectWriter->endDictionary();
 }
예제 #5
0
 /**
  * @iterations 10000
  */
 public function endDictionary()
 {
     $this->objectWriter->endDictionary();
 }