您的位置:首页 > 其它

DOMPDF的utf-8字符换行问题

2017-04-13 02:11 459 查看
找到dompdf\include下的text_frame_reflower.cls.PHP文件:
DOMPDF负责渲染文本的text_frame_reflower.cls.php文件,把以空格、分隔符为界的分割模式,修改为以一个utf-8字符为界的分隔模式。
将此代码:

[php] view
plain copy

// ........text_frame_reflower.cls.php ........  

// split the text into words  

$words = preg_split('/([\s-]+)/u', $text, -1, PREG_SPLIT_DELIM_CAPTURE);  

$wc = count($words);  

// ...............................................  

换成:

[php] view
plain copy

// ........text_frame_reflower.cls.php ........  

// split the text into words  

preg_match_all("/./u", $text, $array);  

$words = array(0);  

$wc = count($words);  

// ...............................................  

// ........text_frame_reflower.cls.php 第50行........
// split the text into words
preg_match_all("/./u", $text, $array);
$words = array[0];
$wc = count($words);
// ...............................................
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐