From: <vv...@us...> - 2012-02-05 02:35:08
|
Revision: 4868 http://web-erp.svn.sourceforge.net/web-erp/?rev=4868&view=rev Author: vvs2012 Date: 2012-02-05 02:35:01 +0000 (Sun, 05 Feb 2012) Log Message: ----------- Fixed addTextWrap() in class.pdf.php. The length of the string was not calculated properly, causing long strings to print beyond the cell boundaries. Modified Paths: -------------- trunk/doc/Change.log trunk/includes/class.pdf.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-02-04 06:21:54 UTC (rev 4867) +++ trunk/doc/Change.log 2012-02-05 02:35:01 UTC (rev 4868) @@ -1,5 +1,6 @@ webERP Change Log +4/2/12 Vitaly: Fixed addTextWrap() in class.pdf.php. The length of the string was not calculated properly, causing long strings to print beyond the cell boundaries. 4/2/12 Phil: Added new API function CreateCreditNote in api_debtortransactions.php 3/2/12 Vitaly:Fixed bug that was not allowing PO lines to be deleted in OrderValue method of PO class was testing using asignment operator not comparison operator 31/1/12 Vitaly: Added DB_escape_string before ItemDescription and SupplierName in GoodsReceived.php to prevent problems with '. Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2012-02-04 06:21:54 UTC (rev 4867) +++ trunk/includes/class.pdf.php 2012-02-05 02:35:01 UTC (rev 4868) @@ -265,11 +265,11 @@ } $this->SetFontSize($Height); - $cw=&$this->CurrentFont['cw']; + if($Width==0) { $Width=$this->w-$this->rMargin-$this->x; } - $wmax=($Width-2*$this->cMargin)*1000/$this->FontSize; + $wmax=($Width-2*$this->cMargin); $s=str_replace("\r",'',$Text); $s=str_replace("\n",' ',$s); $s = trim($s).' '; @@ -295,6 +295,7 @@ $i=0; $l= $ls=0; $ns=0; + $cw = $this->GetStringWidth($s, '', '', 0, true); while($i<$nb) { $c=$s{$i}; if($c==' ' AND $i>0) { @@ -321,7 +322,7 @@ $sep = $i; } else { if($Align=='J') { - $this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; + $this->ws=($ns>1) ? ($wmax-$ls)/($ns-1) : 0; $this->_out(sprintf('%.3f Tw',$this->ws*$this->k)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |