/** * 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_Decorator($frame, $dompdf); parent::__construct($this->_img, $dompdf); list($width, $height) = dompdf_getimagesize($this->_img->get_image_url()); // Resample the bullet image to be consistent with 'auto' sized images // See also Image_Frame_Reflower::get_min_max_width // Tested php ver: value measured in px, suffix "px" not in value: rtrim unnecessary. $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI; $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_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"; }
function __construct(Frame $frame, DOMPDF $dompdf) { if ( !$frame->is_text_node() ) throw new DOMPDF_Exception("Text_Decorator can only be applied to #text nodes."); parent::__construct($frame, $dompdf); $this->_text_spacing = null; }
function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame, $dompdf); $this->_line_boxes = array(new Line_Box($this)); $this->_counters = array(self::DEFAULT_COUNTER => 0); $this->_cl = 0; }
/** * Class constructor * * @param Frame $frame the frame to decorate */ function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame, $dompdf); $this->_page_full = false; $this->_in_table = 0; $this->_bottom_page_margin = null; }
function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame, $dompdf); $this->_lines = array(self::$_initial_line_state); $this->_counters = array(self::DEFAULT_COUNTER => 0); $this->_cl = 0; }
function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame); $url = $frame->get_node()->getAttribute("src"); if (!DOMPDF_ENABLE_REMOTE && strstr($url, "://")) { $this->_remote = false; $this->_image_url = DOMPDF_LIB_DIR . "/res/broken_image.png"; } else { if (DOMPDF_ENABLE_REMOTE && strstr($url, "://")) { // Download remote files to a temporary directory $this->_remote = true; $this->_image_url = tempnam(DOMPDF_TEMP_DIR, "dompdf_img_"); file_put_contents($this->_image_url, file_get_contents($url)); } else { $this->_remote = false; $this->_image_url = build_url($dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path(), $url); } } if (!is_readable($this->_image_url) || !filesize($this->_image_url)) { $this->_remote = false; $this->_image_url = DOMPDF_LIB_DIR . "/res/broken_image.png"; } // We need to preserve the file extenstion $i = strrpos($url, "."); if ($i === false) { throw new DOMPDF_Exception("Unknown image type: {$url}."); } $this->_image_ext = strtolower(substr($url, $i + 1)); }
function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame, $dompdf); $this->_lines = array(array("frames" => array(), "wc" => 0, "y" => null, "w" => 0, "h" => 0)); $this->_counters = array(self::DEFAULT_COUNTER => 0); $this->_cl = 0; }
/** * 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) { global $_dompdf_warnings; parent::__construct($frame, $dompdf); $url = $frame->get_node()->getAttribute("src"); list($this->_image_url, $this->_image_ext) = Image_Cache::resolve_url($url, $dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path()); }
function __construct(Frame $frame) { parent::__construct($frame); $this->_cellmap = new Cellmap($this); $this->_min_width = null; $this->_max_width = null; $this->_state = array(); }
function __construct(Frame $frame) { if ($frame->get_node()->nodeName != "#text") { throw new DOMPDF_Exception("Text_Decorator can only be applied to #text nodes."); } parent::__construct($frame); $this->_text_spacing = null; }
/** * Class constructor * * @param Frame $frame the frame to decorate */ function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame, $dompdf); $this->_cellmap = new Cellmap($this); $this->_min_width = null; $this->_max_width = null; $this->_headers = array(); $this->_footers = array(); }
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; }
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_Decorator($frame, $dompdf); parent::__construct($this->_img, $dompdf); list($width, $height) = dompdf_getimagesize($this->_img->get_image_url()); $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI; $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI; }
/** * Class constructor * * @param Frame $frame the bullet frame to decorate * @param DOMPDF $dompdf the document's dompdf object */ function __construct(Frame $frame, DOMPDF $dompdf) { $url = $frame->get_style()->list_style_image; $frame->get_node()->setAttribute("src", $url); $this->_img = new Image_Frame_Decorator($frame, $dompdf); parent::__construct($this->_img, $dompdf); list($width, $height) = getimagesize($this->_img->get_image_url()); // Resample the bullet image to be consistent with 'auto' sized images $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI; $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI; }
/** * Class constructor * * @param Frame $frame the frame to decorate * @param DOMPDF $dompdf */ 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(); }
/** * 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) = Image_Cache::resolve_url($url, $dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path(), $dompdf); if (Image_Cache::is_broken($this->_image_url) && ($alt = $frame->get_node()->getAttribute("alt"))) { $style = $frame->get_style(); $style->width = 4 / 3 * Font_Metrics::get_text_width($alt, $style->font_family, $style->font_size, $style->word_spacing); $style->height = Font_Metrics::get_font_height($style->font_family, $style->font_size); } }
/** * 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) { global $_dompdf_warnings; parent::__construct($frame, $dompdf); $url = $frame->get_node()->getAttribute("src"); //debugpng if (DEBUGPNG) { print '[__construct ' . $url . ']'; } list($this->_image_url, $this->_image_ext) = Image_Cache::resolve_url($url, $dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path()); if (strrpos($this->_image_url, DOMPDF_LIB_DIR . "/res/broken_image.png", 0) !== false && ($alt = $frame->get_node()->getAttribute("alt"))) { $style = $frame->get_style(); $style->width = 4 / 3 * Font_Metrics::get_text_width($alt, $style->font_family, $style->font_size, $style->word_spacing); $style->height = Font_Metrics::get_font_height($style->font_family, $style->font_size); } }
/** * 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) { global $_dompdf_warnings; parent::__construct($frame, $dompdf); $url = $frame->get_node()->getAttribute("src"); //debugpng if (DEBUGPNG) print '[__construct ' . $url . ']'; list($this->_image_url, $type, $this->_image_msg) = Image_Cache::resolve_url($url, $dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path()); if (Image_Cache::is_broken($this->_image_url) && $alt = $frame->get_node()->getAttribute("alt") ) { $style = $frame->get_style(); $style->width = (4 / 3) * Font_Metrics::get_text_width($alt, $style->font_family, $style->font_size, $style->word_spacing); $style->height = Font_Metrics::get_font_height($style->font_family, $style->font_size); } }
function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame, $dompdf); }
function __construct(Frame $frame) { parent::__construct($frame); }
function __construct(Frame $frame, DOMPDF $dompdf) { parent::__construct($frame, $dompdf); $this->_line_boxes = array(new Line_Box($this)); $this->_cl = 0; }