/** * 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(); }
public function testEndDictionary() { $this->objectWriter->endDictionary(); $this->assertSame('>>', $this->getFileObjectData()); }
/** * 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; }
/** * 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(); }
/** * @iterations 10000 */ public function endDictionary() { $this->objectWriter->endDictionary(); }