Пример #1
0
 /**
  * Process to render block contents.
  * 
  * @param ezcDocumentPdfPage $page 
  * @param ezcDocumentPdfHyphenator $hyphenator 
  * @param ezcDocumentPdfTokenizer $tokenizer 
  * @param ezcDocumentLocateableDomElement $block 
  * @param ezcDocumentPdfMainRenderer $mainRenderer 
  * @return void
  */
 protected function process(ezcDocumentPdfPage $page, ezcDocumentPdfHyphenator $hyphenator, ezcDocumentPdfTokenizer $tokenizer, ezcDocumentLocateableDomElement $block, ezcDocumentPdfMainRenderer $mainRenderer)
 {
     $childNodes = $block->childNodes;
     $nodeCount = $childNodes->length;
     $listItem = 1;
     $itemGenerator = $this->getListItemGenerator($block);
     for ($i = 0; $i < $nodeCount; ++$i) {
         $child = $childNodes->item($i);
         if ($child->nodeType !== XML_ELEMENT_NODE) {
             continue;
         }
         // Default to docbook namespace, if no namespace is defined
         $namespace = $child->namespaceURI === null ? 'http://docbook.org/ns/docbook' : $child->namespaceURI;
         if ($namespace !== 'http://docbook.org/ns/docbook' || $child->tagName !== 'listitem') {
             continue;
         }
         $renderer = new ezcDocumentPdfListItemRenderer($this->driver, $this->styles, $itemGenerator, $listItem++);
         $renderer->renderNode($page, $hyphenator, $tokenizer, $child, $mainRenderer);
     }
 }
Пример #2
0
 /**
  * Handle calls to list item element renderer
  *
  * @param ezcDocumentLocateableDomElement $element
  * @return void
  */
 private function renderListItem(ezcDocumentLocateableDomElement $element)
 {
     $renderer = new ezcDocumentPdfListItemRenderer($this->driver, $this->styles, new ezcDocumentNoListItemGenerator(), 0);
     $page = $this->driver->currentPage();
     return $renderer->renderNode($page, $this->hyphenator, $this->tokenizer, $element, $this);
 }