1<?php
2
3class FeatureWatermark {
4  var $_text;
5
6  function FeatureWatermark() {
7    $this->set_text('');
8  }
9
10  function get_text() {
11    return $this->_text;
12  }
13
14  function handle_after_page($params) {
15    $pipeline =& $params['pipeline'];
16    $document =& $params['document'];
17    $pageno =& $params['pageno'];
18
19    $pipeline->output_driver->_show_watermark($this->get_text());
20  }
21
22  function install(&$pipeline, $params) {
23    $dispatcher =& $pipeline->get_dispatcher();
24    $dispatcher->add_observer('after-page', array(&$this, 'handle_after_page'));
25
26    $this->set_text($params['text']);
27  }
28
29  function set_text($text) {
30    $this->_text = $text;
31  }
32}
33
34?>