Exemplo n.º 1
0
 function show(&$driver)
 {
     // Now set the baseline of a button box to align it vertically when flowing isude the
     // text line
     $this->default_baseline = $this->content[0]->baseline + $this->get_extra_top();
     $this->baseline = $this->content[0]->baseline + $this->get_extra_top();
     /**
      * If we're rendering the interactive form, the field content should not be rendered
      */
     global $g_config;
     if ($g_config['renderforms']) {
         /**
          * Render background/borders only
          */
         $status = GenericFormattedBox::show($driver);
         /**
          * @todo encoding name?
          * @todo font name?
          * @todo check if font is embedded for PDFLIB
          */
         $driver->field_text($this->get_left_padding(), $this->get_top_padding(), $this->get_width() + $this->get_padding_left() + $this->get_padding_right(), $this->get_height(), $this->_value, $this->_field_name);
     } else {
         /**
          * Render everything, including content
          */
         $status = GenericContainerBox::show($driver);
     }
     return $status;
 }
Exemplo n.º 2
0
 function show_field(&$driver)
 {
     if (is_null(GenericFormattedBox::show($driver))) {
         return null;
     }
     $driver->field_select($this->get_left_padding(), $this->get_top_padding(), $this->get_width() + $this->get_padding_left() + $this->get_padding_right(), $this->get_height(), $this->_name, $this->_value, $this->_options);
     return true;
 }
Exemplo n.º 3
0
 function show(&$driver)
 {
     /**
      * If we're rendering the interactive form, the field content should not be rendered
      */
     global $g_config;
     if ($g_config['renderforms']) {
         $status = GenericFormattedBox::show($driver);
         $driver->field_multiline_text($this->get_left_padding(), $this->get_top_padding(), $this->get_width() + $this->get_padding_left() + $this->get_padding_right(), $this->get_height() + $this->get_padding_top() + $this->get_padding_bottom(), $this->_value, $this->_field_name);
     } else {
         $status = GenericContainerBox::show($driver);
     }
     return $status;
 }
 function show(&$driver)
 {
     // draw generic box
     GenericFormattedBox::show($driver);
     // Check if "designer" set the height or width of this image to zero; in this there will be no reason
     // in drawing the image at all
     //
     if ($this->get_width() < EPSILON || $this->get_height() < EPSILON || is_null($this->image->_handle)) {
         return true;
     }
     $driver->image_scaled($this->image, $this->get_left(), $this->get_bottom(), $this->get_width() / $this->image->sx(), $this->get_height() / $this->image->sy());
     $strategy =& new StrategyLinkRenderingNormal();
     $strategy->apply($this, $driver);
     return true;
 }
Exemplo n.º 5
0
 /** 
  * Render current fixed-positioned container box using the specified output method. Unlike
  * the 'show' method, there's no check if current page viewport contains current element, as
  * fixed-positioned may be drawn on the page margins, outside the viewport.
  *
  * @param OutputDriver $driver The output driver object
  * 
  * @return Boolean flag indicating the success or 'null' value in case of critical rendering 
  * error
  *
  * @see GenericContainerBox::show()
  * 
  * @todo the 'show' and 'show_fixed' method code are almost the same except the child element 
  * method called in the inner loop; also, no check is done if current viewport contains this element,
  * thus sllowinf printing data on page margins, where no data should be printed normally
  * I suppose some more generic method containing the common code should be made.
  */
 function show_fixed(&$driver)
 {
     GenericFormattedBox::show($driver);
     $overflow = $this->getCSSProperty(CSS_OVERFLOW);
     /**
      * Sometimes the content may overflow container boxes. This situation arise, for example,
      * for relative-positioned child boxes, boxes having constrained height and in some
      * other cases. If the container box does not have CSS 'overflow' property 
      * set to 'visible' value, the content should be visually clipped using container box
      * padding area.
      */
     if ($overflow !== OVERFLOW_VISIBLE) {
         // Save graphics state (of course, BEFORE the clipping area will be set)
         $driver->save();
         $this->_setupClip($driver);
     }
     /**
      * Render child elements
      */
     $size = count($this->content);
     for ($i = 0; $i < $size; $i++) {
         /**
          * We'll check the visibility property here
          * Reason: all boxes (except the top-level one) are contained in some other box, 
          * so every box will pass this check. The alternative is to add this check into every
          * box class show member.
          *
          * The only exception of absolute positioned block boxes which are drawn separately;
          * their show method is called explicitly; the similar check should be performed there
          */
         $child =& $this->content[$i];
         if ($child->getCSSProperty(CSS_VISIBILITY) === VISIBILITY_VISIBLE) {
             // Fixed-positioned blocks are displayed separately;
             // If we call them now, they will be drawn twice
             if ($child->getCSSProperty(CSS_POSITION) != POSITION_FIXED) {
                 if (is_null($child->show_fixed($driver))) {
                     return null;
                 }
             }
         }
     }
     /** 
      * Restore previous clipping mode, if it have been modified for non-'overflow: visible' 
      * box.
      */
     if ($overflow !== OVERFLOW_VISIBLE) {
         $driver->restore();
     }
     return true;
 }
Exemplo n.º 6
0
 function show(&$viewport)
 {
     // draw generic box
     GenericFormattedBox::show($viewport);
     // Check if "designer" set the height or width of this image to zero; in this there will be no reason
     // in drawing the image at all
     //
     if ($this->get_width() < EPSILON || $this->get_height() < EPSILON) {
         return true;
     }
     $viewport->image_scaled($this->image, $this->get_left(), $this->get_bottom(), $this->get_width() / imagesx($this->image), $this->get_height() / imagesy($this->image));
     return true;
 }