当前位置: 首页>>代码示例>>PHP>>正文


PHP Converter::create方法代码示例

本文整理汇总了PHP中Converter::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::create方法的具体用法?PHP Converter::create怎么用?PHP Converter::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Converter的用法示例。


在下文中一共展示了Converter::create方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: IFrameBox

 function IFrameBox(&$root, $pipeline)
 {
     $this->InlineBlockBox();
     // If NO src attribute specified, just return.
     if (!$root->has_attribute('src') || trim($root->get_attribute('src')) == '') {
         return;
     }
     // Determine the fullly qualified URL of the frame content
     $src = $root->get_attribute('src');
     $url = $pipeline->guess_url($src);
     $data = $pipeline->fetch($url);
     /**
      * If framed page could not be fetched return immediately
      */
     if (is_null($data)) {
         return;
     }
     /**
      * Render only iframes containing HTML only
      *
      * Note that content-type header may contain additional information after the ';' sign
      */
     $content_type = $data->get_additional_data('Content-Type');
     $content_type_array = explode(';', $content_type);
     if ($content_type_array[0] != "text/html") {
         return;
     }
     $html = $data->get_content();
     // Remove control symbols if any
     $html = preg_replace('/[\\x00-\\x07]/', "", $html);
     $converter = Converter::create();
     $html = $converter->to_utf8($html, $data->detect_encoding());
     $html = html2xhtml($html);
     $tree = TreeBuilder::build($html);
     // Save current stylesheet, as each frame may load its own stylesheets
     //
     $pipeline->pushCSS();
     $css =& $pipeline->getCurrentCSS();
     $css->scan_styles($tree, $pipeline);
     $frame_root = traverse_dom_tree_pdf($tree);
     $box_child =& create_pdf_box($frame_root, $pipeline);
     $this->add_child($box_child);
     // Restore old stylesheet
     //
     $pipeline->popCSS();
     $pipeline->pop_base_url();
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:47,代码来源:box.iframe.php

示例2: process

 function process(&$data)
 {
     // Remove control symbols if any
     $data->set_content(preg_replace('/[\\x00-\\x07]/', "", $data->get_content()));
     if (empty($this->encoding)) {
         $encoding = $data->detect_encoding();
         if (is_null($encoding)) {
             $encoding = DEFAULT_ENCODING;
         }
         $converter = Converter::create();
         $data->set_content($converter->to_utf8($data->get_content(), $encoding));
     } else {
         $converter = Converter::create();
         $data->set_content($converter->to_utf8($data->get_content(), $this->encoding));
     }
     return $data;
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:17,代码来源:filter.data.encoding.class.php

示例3: FrameBox

 function FrameBox(&$root, &$pipeline)
 {
     $css_state =& $pipeline->getCurrentCSSState();
     // Inherit 'border' CSS value from parent (FRAMESET tag), if current FRAME
     // has no FRAMEBORDER attribute, and FRAMESET has one
     $parent = $root->parent();
     if (!$root->has_attribute('frameborder') && $parent->has_attribute('frameborder')) {
         $parent_border = $css_state->getPropertyOnLevel(CSS_BORDER, CSS_PROPERTY_LEVEL_PARENT);
         $css_state->setProperty(CSS_BORDER, $parent_border->copy());
     }
     $this->GenericContainerBox($root);
     // If NO src attribute specified, just return.
     if (!$root->has_attribute('src')) {
         return;
     }
     // Determine the fullly qualified URL of the frame content
     $src = $root->get_attribute('src');
     $url = $pipeline->guess_url($src);
     $data = $pipeline->fetch($url);
     /**
      * If framed page could not be fetched return immediately
      */
     if (is_null($data)) {
         return;
     }
     /**
      * Render only iframes containing HTML only
      *
      * Note that content-type header may contain additional information after the ';' sign
      */
     $content_type = $data->get_additional_data('Content-Type');
     $content_type_array = explode(';', $content_type);
     if ($content_type_array[0] != "text/html") {
         return;
     }
     $html = $data->get_content();
     // Remove control symbols if any
     $html = preg_replace('/[\\x00-\\x07]/', "", $html);
     $converter = Converter::create();
     $html = $converter->to_utf8($html, $data->detect_encoding());
     $html = html2xhtml($html);
     $tree = TreeBuilder::build($html);
     // Save current stylesheet, as each frame may load its own stylesheets
     //
     $pipeline->pushCSS();
     $css =& $pipeline->getCurrentCSS();
     $css->scan_styles($tree, $pipeline);
     $frame_root = traverse_dom_tree_pdf($tree);
     $box_child =& create_pdf_box($frame_root, $pipeline);
     $this->add_child($box_child);
     // Restore old stylesheet
     //
     $pipeline->popCSS();
     $pipeline->pop_base_url();
 }
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:55,代码来源:box.frame.php

示例4: FrameBox

 function FrameBox(&$root, &$pipeline)
 {
     // Inherit 'border' CSS value from parent (FRAMESET tag), if current FRAME
     // has no FRAMEBORDER attribute, and FRAMESET has one
     $parent = $root->parent();
     if (!$root->has_attribute('frameborder') && $parent->has_attribute('frameborder')) {
         pop_border();
         push_border(get_border());
     }
     $this->GenericContainerBox($root);
     // If NO src attribute specified, just return.
     if (!$root->has_attribute('src')) {
         return;
     }
     // Determine the fullly qualified URL of the frame content
     $src = $root->get_attribute('src');
     $url = $pipeline->guess_url($src);
     $data = $pipeline->fetch($url);
     /**
      * If framed page could not be fetched return immediately
      */
     if (is_null($data)) {
         return;
     }
     /**
      * Render only iframes containing HTML only
      *
      * Note that content-type header may contain additional information after the ';' sign
      */
     $content_type = $data->get_additional_data('Content-Type');
     $content_type_array = explode(';', $content_type);
     if ($content_type_array[0] != "text/html") {
         return;
     }
     $html = $data->get_content();
     // Remove control symbols if any
     $html = preg_replace('/[\\x00-\\x07]/', "", $html);
     $converter = Converter::create();
     $html = $converter->to_utf8($html, $data->detect_encoding());
     $html = html2xhtml($html);
     $tree = TreeBuilder::build($html);
     // Save current stylesheet, as each frame may load its own stylesheets
     //
     global $g_css;
     $old_css = $g_css;
     global $g_css_obj;
     $old_obj = $g_css_obj;
     scan_styles($tree, $pipeline);
     // Temporary hack: convert CSS rule array to CSS object
     $g_css_obj = new CSSObject();
     foreach ($g_css as $rule) {
         $g_css_obj->add_rule($rule, $pipeline);
     }
     // TODO: stinks. Rewrite
     //
     $frame_root = traverse_dom_tree_pdf($tree);
     $box_child =& create_pdf_box($frame_root, $pipeline);
     $this->add_child($box_child);
     // Restore old stylesheet
     //
     $g_css = $old_css;
     $g_css_obj = $old_obj;
     $pipeline->pop_base_url();
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:64,代码来源:box.frame.php

示例5: show_xy

 function show_xy($text, $x, $y)
 {
     $this->_fixCoords($x, $y);
     $font = $this->_getFont();
     $converter = Converter::create();
     global $g_font_resolver_pdf;
     $fontFile = $g_font_resolver_pdf->ttf_mappings[$font['font']];
     $fontSize = $font['size'];
     $dummy = 0;
     $this->_fixSizes($dummy, $fontSize);
     $utf8_string = $converter->to_utf8($text, $font['encoding']);
     imagefttext($this->_image, $fontSize * $font['ascender'], 0, $x, $y, $this->_getCurrentColor(), TTF_FONTS_REPOSITORY . $fontFile, $utf8_string);
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:13,代码来源:output.png.class.php

示例6: _convert

 function _convert(&$data, $encoding)
 {
     $converter = Converter::create();
     $data->set_content($converter->to_ucs2($data->get_content(), $encoding));
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:5,代码来源:filter.data.ucs2.class.php


注:本文中的Converter::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。