Dompdf: Word-wrapping 0.7.0-beta2

Created on 15 Dec 2015  路  3Comments  路  Source: dompdf/dompdf

I have some problems with word-wrapping using dompdf 0.7.0 beta 2 (PHP 5.4.45), seems related to #152 .

require_once "lib/dompdfv7/autoload.inc.php";
use Dompdf\Dompdf;

$pdf = new Dompdf();
$pdf->set_paper("A4");
$pdf->set_option("defaultFont", "sans-serif");

$html = "<!DOCTYPE html>\n";
$html .= "<html>\n";
$html .= "<head>\n";
$html .= "<meta charset='utf-8' />\n";
$html .= "<title>PDF</title>\n";
$html .= "</head>\n";
$html .= "<body>\n";
$html .= "<p style='font-size:13px;'>Vielen Dank f眉r Ihr Interesse an unseren Versicherungsprodukten. Gem盲脽 Ihren Angaben machen wir Ihnen folgenden Vorschlag.</p>\n";
$html .= "</body>\n";
$html .= "</html>\n";

$pdf->load_html($html);
$pdf->render();
$pdf->stream("test", array("Attachment" => false));

pdf-word-wrap

After adding the line

$split = mb_strlen(mb_substr($this->_frame->get_text(), 0, $split), 'UTF-8');

in src/FrameReflower/Text.php before line 273 "if ($split == 0) {", word-wrapping behaves correctly.

pdf-word-wrap-fixed

bug

Most helpful comment

Nothing yet, but I'll add it for the next release.

All 3 comments

That's ... unexpected. I would expect the split value to already be set correctly. We'll take a closer look.

Any updates on this?

Still experiencing this bug in 0.8.3 :(

Proposed fix still works...

Nothing yet, but I'll add it for the next release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AnarchyChampion picture AnarchyChampion  路  3Comments

PhenX picture PhenX  路  3Comments

halfer picture halfer  路  4Comments

Joshuavoosten picture Joshuavoosten  路  3Comments

sunscreem picture sunscreem  路  4Comments