コード例 #1
0
ファイル: ListBulletImage.php プロジェクト: onyxnz/quartzpos
 /**
  * Class constructor
  *
  * @param Frame $frame   the bullet frame to decorate
  * @param Dompdf $dompdf the document's dompdf object
  */
 function __construct(Frame $frame, Dompdf $dompdf)
 {
     $style = $frame->get_style();
     $url = $style->list_style_image;
     $frame->get_node()->setAttribute("src", $url);
     $this->_img = new Image($frame, $dompdf);
     parent::__construct($this->_img, $dompdf);
     list($width, $height) = Helpers::dompdf_getimagesize($this->_img->get_image_url());
     // Resample the bullet image to be consistent with 'auto' sized images
     // See also Image::get_min_max_width
     // Tested php ver: value measured in px, suffix "px" not in value: rtrim unnecessary.
     $dpi = $this->_dompdf->get_option("dpi");
     $this->_width = (double) rtrim($width, "px") * 72 / $dpi;
     $this->_height = (double) rtrim($height, "px") * 72 / $dpi;
     //If an image is taller as the containing block/box, the box should be extended.
     //Neighbour elements are overwriting the overlapping image areas.
     //Todo: Where can the box size be extended?
     //Code below has no effect.
     //See block_frame_reflower _calculate_restricted_height
     //See generated_frame_reflower, Dompdf:render() "list-item", "-dompdf-list-bullet"S.
     //Leave for now
     //if ($style->min_height < $this->_height ) {
     //  $style->min_height = $this->_height;
     //}
     //$style->height = "auto";
 }
コード例 #2
0
ファイル: Page.php プロジェクト: BrunoDeBarros/dompdf
 /**
  * Class constructor
  *
  * @param Frame $frame the frame to decorate
  * @param Dompdf $dompdf
  */
 function __construct(Frame $frame, Dompdf $dompdf)
 {
     parent::__construct($frame, $dompdf);
     $this->_page_full = false;
     $this->_in_table = 0;
     $this->_bottom_page_margin = null;
 }
コード例 #3
0
ファイル: Text.php プロジェクト: AlexandreSGV/siteentec
 function __construct(Frame $frame, Dompdf $dompdf)
 {
     if (!$frame->is_text_node()) {
         throw new Exception("Text_Decorator can only be applied to #text nodes.");
     }
     parent::__construct($frame, $dompdf);
     $this->_text_spacing = null;
 }
コード例 #4
0
 function __construct(Frame $frame, Dompdf $dompdf)
 {
     parent::__construct($frame, $dompdf);
     $style = $this->_frame->get_style();
     $style->width = 0;
     $style->height = 0;
     $style->margin = 0;
     $style->padding = 0;
 }
コード例 #5
0
ファイル: Table.php プロジェクト: AlexandreSGV/siteentec
 /**
  * Class constructor
  *
  * @param Frame $frame the frame to decorate
  * @param Dompdf $dompdf
  */
 public function __construct(Frame $frame, Dompdf $dompdf)
 {
     parent::__construct($frame, $dompdf);
     $this->_cellmap = new Cellmap($this);
     if ($frame->get_style()->table_layout === "fixed") {
         $this->_cellmap->set_layout_fixed(true);
     }
     $this->_min_width = null;
     $this->_max_width = null;
     $this->_headers = array();
     $this->_footers = array();
 }
コード例 #6
0
ファイル: Image.php プロジェクト: AlexandreSGV/siteentec
 /**
  * Class constructor
  *
  * @param Frame $frame the frame to decorate
  * @param DOMPDF $dompdf the document's dompdf object (required to resolve relative & remote urls)
  */
 function __construct(Frame $frame, Dompdf $dompdf)
 {
     parent::__construct($frame, $dompdf);
     $url = $frame->get_node()->getAttribute("src");
     $debug_png = $dompdf->get_option("debug_png");
     if ($debug_png) {
         print '[__construct ' . $url . ']';
     }
     list($this->_image_url, , $this->_image_msg) = Cache::resolve_url($url, $dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path(), $dompdf);
     if (Cache::is_broken($this->_image_url) && ($alt = $frame->get_node()->getAttribute("alt"))) {
         $style = $frame->get_style();
         $style->width = 4 / 3 * $dompdf->getFontMetrics()->getTextWidth($alt, $style->font_family, $style->font_size, $style->word_spacing);
         $style->height = $dompdf->getFontMetrics()->getFontHeight($style->font_family, $style->font_size);
     }
 }
コード例 #7
0
 /**
  * Class constructor
  *
  * @param Frame $frame   Frame to decorate
  * @param Dompdf $dompdf Current dompdf instance
  */
 function __construct(Frame $frame, Dompdf $dompdf)
 {
     parent::__construct($frame, $dompdf);
 }
コード例 #8
0
ファイル: Block.php プロジェクト: AlexandreSGV/siteentec
 function __construct(Frame $frame, Dompdf $dompdf)
 {
     parent::__construct($frame, $dompdf);
     $this->_line_boxes = array(new LineBox($this));
     $this->_cl = 0;
 }