Skip to content

Instantly share code, notes, and snippets.

@totoleo
Created June 23, 2016 07:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save totoleo/81fc96ef5e035a96cc488116ce968d8f to your computer and use it in GitHub Desktop.
Save totoleo/81fc96ef5e035a96cc488116ce968d8f to your computer and use it in GitHub Desktop.
//解決DOMPDF中文自動換行的問題;@phpdb.net
preg_match_all('/./u', $text, $array);
$words = $array[0];
$wc = count($words);
@totoleo
Copy link
Author

totoleo commented Jun 23, 2016

text_frame_reflower.cls.php L:84

@totoleo
Copy link
Author

totoleo commented Jun 23, 2016

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

这是原文

@goodspeed666
Copy link

goodspeed666 commented Jun 18, 2019

Thank you, it's work !

File location is /vendor/dompdf/dompdf/src/FrameReflower/Text.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment