Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
Untitled diff
创建于
11年前
差异永不过期
清除
导出
分享
解释
38 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
112 行
全部复制
23 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
91 行
全部复制
复制
已复制
复制
已复制
function
MultiCell
($w, $h, $txt, $border=
0
, $align='J'
, $fill=false)
function
Get
MultiCell
Height
($w, $h, $txt, $border=
null
, $align='J'
)
{
{
//
Calculate MultiCell
with automatic or explicit line breaks
height
//
Output text
with automatic or explicit line breaks
// $border is un-used, but I kept it in the parameters to keep the call
// to this function consistent with MultiCell()
$cw = &$this->CurrentFont['cw'];
$cw = &$this->CurrentFont['cw'];
if($w==0)
if($w==0)
$w = $this->w-$this->rMargin-$this->x;
$w = $this->w-$this->rMargin-$this->x;
$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
$s = str_replace("\r",'',$txt);
$s = str_replace("\r",'',$txt);
$nb = strlen($s);
$nb = strlen($s);
if($nb>0 && $s[$nb-1]=="\n")
if($nb>0 && $s[$nb-1]=="\n")
$nb--;
$nb--;
复制
已复制
复制
已复制
$b = 0;
if($border)
{
if($border==1)
{
$border = 'LTRB';
$b = 'LRT';
$b2 = 'LR';
}
else
{
$b2 = '';
if(strpos($border,'L')!==false)
$b2 .= 'L';
if(strpos($border,'R')!==false)
$b2 .= 'R';
$b = (strpos($border,'T')!==false) ? $b2.'T' : $b2;
}
}
$sep = -1;
$sep = -1;
$i = 0;
$i = 0;
$j = 0;
$j = 0;
$l = 0;
$l = 0;
$ns = 0;
$ns = 0;
复制
已复制
复制
已复制
$
nl
=
1
;
$
height
=
0
;
while($i<$nb)
while($i<$nb)
{
{
// Get next character
// Get next character
$c = $s[$i];
$c = $s[$i];
if($c=="\n")
if($c=="\n")
{
{
// Explicit line break
// Explicit line break
if($this->ws>0)
if($this->ws>0)
{
{
$this->ws = 0;
$this->ws = 0;
$this->_out('0 Tw');
$this->_out('0 Tw');
}
}
复制
已复制
复制
已复制
$
this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill)
;
//Increase Height
$
height += $h
;
$i++;
$i++;
$sep = -1;
$sep = -1;
$j = $i;
$j = $i;
$l = 0;
$l = 0;
$ns = 0;
$ns = 0;
复制
已复制
复制
已复制
$nl++;
if($border && $nl==2)
$b = $b2;
continue;
continue;
}
}
if($c==' ')
if($c==' ')
{
{
$sep = $i;
$sep = $i;
$ls = $l;
$ls = $l;
$ns++;
$ns++;
}
}
$l += $cw[$c];
$l += $cw[$c];
if($l>$wmax)
if($l>$wmax)
{
{
// Automatic line break
// Automatic line break
if($sep==-1)
if($sep==-1)
{
{
if($i==$j)
if($i==$j)
$i++;
$i++;
if($this->ws>0)
if($this->ws>0)
{
{
$this->ws = 0;
$this->ws = 0;
$this->_out('0 Tw');
$this->_out('0 Tw');
}
}
复制
已复制
复制
已复制
$
this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill)
;
//Increase Height
$
height += $h
;
}
}
else
else
{
{
if($align=='J')
if($align=='J')
{
{
$this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
$this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
$this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
$this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
}
}
复制
已复制
复制
已复制
$this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill)
;
//Increase Height
$height += $h
;
$i = $sep+1;
$i = $sep+1;
}
}
$sep = -1;
$sep = -1;
$j = $i;
$j = $i;
$l = 0;
$l = 0;
$ns = 0;
$ns = 0;
复制
已复制
复制
已复制
$nl++;
if($border && $nl==2)
$b = $b2;
}
}
else
else
$i++;
$i++;
}
}
// Last chunk
// Last chunk
if($this->ws>0)
if($this->ws>0)
{
{
$this->ws = 0;
$this->ws = 0;
$this->_out('0 Tw');
$this->_out('0 Tw');
}
}
复制
已复制
复制
已复制
if($border && strpos($border,'B')!==false)
//Increase Height
$b .= 'B';
$
height += $h
;
$
this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill)
;
$this->x = $this->lMargin
;
return $height
;
}
}
已保存差异
原始文本
打开文件
function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false) { // Output text with automatic or explicit line breaks $cw = &$this->CurrentFont['cw']; if($w==0) $w = $this->w-$this->rMargin-$this->x; $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; $s = str_replace("\r",'',$txt); $nb = strlen($s); if($nb>0 && $s[$nb-1]=="\n") $nb--; $b = 0; if($border) { if($border==1) { $border = 'LTRB'; $b = 'LRT'; $b2 = 'LR'; } else { $b2 = ''; if(strpos($border,'L')!==false) $b2 .= 'L'; if(strpos($border,'R')!==false) $b2 .= 'R'; $b = (strpos($border,'T')!==false) ? $b2.'T' : $b2; } } $sep = -1; $i = 0; $j = 0; $l = 0; $ns = 0; $nl = 1; while($i<$nb) { // Get next character $c = $s[$i]; if($c=="\n") { // Explicit line break if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); $i++; $sep = -1; $j = $i; $l = 0; $ns = 0; $nl++; if($border && $nl==2) $b = $b2; continue; } if($c==' ') { $sep = $i; $ls = $l; $ns++; } $l += $cw[$c]; if($l>$wmax) { // Automatic line break if($sep==-1) { if($i==$j) $i++; if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); } else { if($align=='J') { $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; $this->_out(sprintf('%.3F Tw',$this->ws*$this->k)); } $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); $i = $sep+1; } $sep = -1; $j = $i; $l = 0; $ns = 0; $nl++; if($border && $nl==2) $b = $b2; } else $i++; } // Last chunk if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } if($border && strpos($border,'B')!==false) $b .= 'B'; $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); $this->x = $this->lMargin; }
更改后文本
打开文件
function GetMultiCellHeight($w, $h, $txt, $border=null, $align='J') { // Calculate MultiCell with automatic or explicit line breaks height // $border is un-used, but I kept it in the parameters to keep the call // to this function consistent with MultiCell() $cw = &$this->CurrentFont['cw']; if($w==0) $w = $this->w-$this->rMargin-$this->x; $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; $s = str_replace("\r",'',$txt); $nb = strlen($s); if($nb>0 && $s[$nb-1]=="\n") $nb--; $sep = -1; $i = 0; $j = 0; $l = 0; $ns = 0; $height = 0; while($i<$nb) { // Get next character $c = $s[$i]; if($c=="\n") { // Explicit line break if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } //Increase Height $height += $h; $i++; $sep = -1; $j = $i; $l = 0; $ns = 0; continue; } if($c==' ') { $sep = $i; $ls = $l; $ns++; } $l += $cw[$c]; if($l>$wmax) { // Automatic line break if($sep==-1) { if($i==$j) $i++; if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } //Increase Height $height += $h; } else { if($align=='J') { $this->ws = ($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0; $this->_out(sprintf('%.3F Tw',$this->ws*$this->k)); } //Increase Height $height += $h; $i = $sep+1; } $sep = -1; $j = $i; $l = 0; $ns = 0; } else $i++; } // Last chunk if($this->ws>0) { $this->ws = 0; $this->_out('0 Tw'); } //Increase Height $height += $h; return $height; }
查找差异