DOMPDF的utf-8字符换行问题

找到dompdf\include下的text_frame_reflower.cls.PHP文件:

DOMPDF负责渲染文本的text_frame_reflower.cls.php文件,把以空格、分隔符为界的分割模式,修改为以一个utf-8字符为界的分隔模式。

将此代码:

[php]  view plain  copy
  1. // ........text_frame_reflower.cls.php ........  
  2. // split the text into words  
  3. $words = preg_split('/([\s-]+)/u'$text, -1, PREG_SPLIT_DELIM_CAPTURE);  
  4. $wc = count($words);  
  5. // ...............................................  

换成:

[php]  view plain  copy
  1. // ........text_frame_reflower.cls.php ........  
  2. // split the text into words  
  3. preg_match_all("/./u"$text$array);  
  4. $words = array(0);  
  5. $wc = count($words);  
  6. // ...............................................  




// ........text_frame_reflower.cls.php 第50行........
// split the text into words
preg_match_all("/./u", $text, $array);
$words = array[0];
$wc = count($words);
// ...............................................

猜你喜欢

转载自blog.csdn.net/tianlebest/article/details/70151695