<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: DOMPDF + justification + extended ASCII chars</title>
	<atom:link href="http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/feed/" rel="self" type="application/rss+xml" />
	<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars</link>
	<description>Luca Priorelli's Blog</description>
	<lastBuildDate>Wed, 01 Sep 2010 16:41:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Álvaro</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1335</link>
		<dc:creator>Álvaro</dc:creator>
		<pubDate>Thu, 08 Jul 2010 18:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1335</guid>
		<description>Hi,
I&#039;m not sure if this is the same problem related with this post, but here it goes:
- Words inside table cells and/or divs are splited the wrong way... For exemple... at the end of the line a word like &#039;computer&#039; is splitted com (line break here)
puted.
I&#039;m using domPDF 0.5.1.
Any help would be appreciated.
Thanxs in advance :)
Álvaro

P.S. - I can send an url that create a PDF with this errors as well.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I&#8217;m not sure if this is the same problem related with this post, but here it goes:<br />
- Words inside table cells and/or divs are splited the wrong way&#8230; For exemple&#8230; at the end of the line a word like &#8216;computer&#8217; is splitted com (line break here)<br />
puted.<br />
I&#8217;m using domPDF 0.5.1.<br />
Any help would be appreciated.<br />
Thanxs in advance <img src='http://luca.priorelli.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Álvaro</p>
<p>P.S. &#8211; I can send an url that create a PDF with this errors as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Albert</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1285</link>
		<dc:creator>Albert</dc:creator>
		<pubDate>Mon, 21 Jun 2010 07:53:48 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1285</guid>
		<description>With the version 0.6 and windows there is solved the problem of the loss of lines by the following change

text_frame_reflower.cls.php line 153 $offset = strlen($str);</description>
		<content:encoded><![CDATA[<p>With the version 0.6 and windows there is solved the problem of the loss of lines by the following change</p>
<p>text_frame_reflower.cls.php line 153 $offset = strlen($str);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Albert</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1231</link>
		<dc:creator>Albert</dc:creator>
		<pubDate>Thu, 10 Jun 2010 19:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1231</guid>
		<description>Hello. Luca.
 I am using dompdf with the library CPDF with the modifications that you propose. It works well, but I meet a serious problem. If the last character of the line is a special, the following lines of the paragraph disappear.
 Can you help me to find a solution?
 With this failure, dompdf is not valid since the lines disappear in a random way.
 Thank you very much.</description>
		<content:encoded><![CDATA[<p>Hello. Luca.<br />
 I am using dompdf with the library CPDF with the modifications that you propose. It works well, but I meet a serious problem. If the last character of the line is a special, the following lines of the paragraph disappear.<br />
 Can you help me to find a solution?<br />
 With this failure, dompdf is not valid since the lines disappear in a random way.<br />
 Thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1139</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 21 Apr 2010 21:13:46 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1139</guid>
		<description>in fact this is slightly better

    if ($frame-&gt;get_node()-&gt;nodeName == &quot;#text&quot;)
	  $text = trim($frame-&gt;get_text());
      $this-&gt;_lines[$this-&gt;_cl][&quot;wc&quot;] = count(preg_split(&quot;/\s+/&quot;,  $text ));
	  $this-&gt;_lines[$this-&gt;_cl][&quot;w&quot;] += $w;
	  
	  if (substr($text, -1) != &quot;-&quot; &amp;&amp; substr($text, -1) != &quot;.&quot; ){
	    $this-&gt;_lines[$this-&gt;_cl][&quot;justify&quot;] = -2;
	  }

and then 

            $spacing = ($width - ($line[&quot;w&quot;] + $line[&quot;justify&quot;])) / ($line[&quot;wc&quot;] -1);

(to sort out line breaks and fullstops.</description>
		<content:encoded><![CDATA[<p>in fact this is slightly better</p>
<p>    if ($frame-&gt;get_node()-&gt;nodeName == &#8220;#text&#8221;)<br />
	  $text = trim($frame-&gt;get_text());<br />
      $this-&gt;_lines[$this-&gt;_cl]["wc"] = count(preg_split(&#8220;/\s+/&#8221;,  $text ));<br />
	  $this-&gt;_lines[$this-&gt;_cl]["w"] += $w;</p>
<p>	  if (substr($text, -1) != &#8220;-&#8221; &amp;&amp; substr($text, -1) != &#8220;.&#8221; ){<br />
	    $this-&gt;_lines[$this-&gt;_cl]["justify"] = -2;<br />
	  }</p>
<p>and then </p>
<p>            $spacing = ($width &#8211; ($line["w"] + $line["justify"])) / ($line["wc"] -1);</p>
<p>(to sort out line breaks and fullstops.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1138</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 21 Apr 2010 21:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1138</guid>
		<description>ok add something like this

	  if (substr($text, -1) == &quot;-&quot; &#124;&#124; substr($text, -1) == &quot;.&quot; ){
	    $this-&gt;_lines[$this-&gt;_cl][&quot;wc&quot;] += 1;
	  }else{
	    $this-&gt;_lines[$this-&gt;_cl][&quot;justify&quot;] = -2;
	  }

to

block_frame_decorator.cls.php on lne 192

AND

add this 
            $spacing = ($width - ($line[&quot;w&quot;] + $line[&quot;justify&quot;])) / ($line[&quot;wc&quot;] -2);

to block_frame_reflower.cls.php line 431.

basically the maths is wrong for it. It hasn&#039;t accounted for the extra white spaces on each line that occur. 

they will be a tidy way of doing this and it probably involves trimming the white spaces for each line but this highlghts the problem</description>
		<content:encoded><![CDATA[<p>ok add something like this</p>
<p>	  if (substr($text, -1) == &#8220;-&#8221; || substr($text, -1) == &#8220;.&#8221; ){<br />
	    $this-&gt;_lines[$this-&gt;_cl]["wc"] += 1;<br />
	  }else{<br />
	    $this-&gt;_lines[$this-&gt;_cl]["justify"] = -2;<br />
	  }</p>
<p>to</p>
<p>block_frame_decorator.cls.php on lne 192</p>
<p>AND</p>
<p>add this<br />
            $spacing = ($width &#8211; ($line["w"] + $line["justify"])) / ($line["wc"] -2);</p>
<p>to block_frame_reflower.cls.php line 431.</p>
<p>basically the maths is wrong for it. It hasn&#8217;t accounted for the extra white spaces on each line that occur. </p>
<p>they will be a tidy way of doing this and it probably involves trimming the white spaces for each line but this highlghts the problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1137</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 21 Apr 2010 20:49:28 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1137</guid>
		<description>I have found the solution , there are some issues in the way the code generates the spacing for each line.  It will only work for the first and last line, not the rest. . will explain when  get this working</description>
		<content:encoded><![CDATA[<p>I have found the solution , there are some issues in the way the code generates the spacing for each line.  It will only work for the first and last line, not the rest. . will explain when  get this working</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1136</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 21 Apr 2010 19:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1136</guid>
		<description>well I have made the string replacement but can&#039;t find it on page.cache and then added the static diff array to the top of the cpdf_adapter.cls.php but it makes no difference the right side just isn&#039;t aligning correctly when I justify it. Each line is somewhere between 0 and 10 pixels out. 

Its not much i know but you can really notice it.</description>
		<content:encoded><![CDATA[<p>well I have made the string replacement but can&#8217;t find it on page.cache and then added the static diff array to the top of the cpdf_adapter.cls.php but it makes no difference the right side just isn&#8217;t aligning correctly when I justify it. Each line is somewhere between 0 and 10 pixels out. </p>
<p>Its not much i know but you can really notice it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luca Priorelli</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1134</link>
		<dc:creator>Luca Priorelli</dc:creator>
		<pubDate>Wed, 21 Apr 2010 16:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1134</guid>
		<description>@mike - If you provide an example I can use it to test it with the latest code. I have also done some work to make DOMPDF work with another PDF library (TCPDF) and I would like to see how well it works.</description>
		<content:encoded><![CDATA[<p>@mike &#8211; If you provide an example I can use it to test it with the latest code. I have also done some work to make DOMPDF work with another PDF library (TCPDF) and I would like to see how well it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1133</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 21 Apr 2010 15:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1133</guid>
		<description>I cant get this work either, done everything above but still no joy (version 0.5.1)</description>
		<content:encoded><![CDATA[<p>I cant get this work either, done everything above but still no joy (version 0.5.1)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maicon</title>
		<link>http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/comment-page-1/#comment-1025</link>
		<dc:creator>Maicon</dc:creator>
		<pubDate>Wed, 10 Mar 2010 17:45:50 +0000</pubDate>
		<guid isPermaLink="false">http://luca.priorelli.com/index.php/2007/08/25/dompdf-justification-extended-ascii-chars/#comment-1025</guid>
		<description>yes very good</description>
		<content:encoded><![CDATA[<p>yes very good</p>
]]></content:encoded>
	</item>
</channel>
</rss>
