Diff
checker
Texto
Texto
Imágenes
Documentos
Excel
Carpetas
Legal
Enterprise
Aplicación de escritorio
Precios
Iniciar sesión
Descargar Diffchecker Desktop
Comparar texto
Encuentra la diferencia entre dos archivos de texto
Herramientas
Historial
Editor live
Ocultar sin cambios
Sin ajuste de línea
Vista
Dividido
Unificado
Nivel de detalle
Inteligente
Palabra
Letra
Resaltado de sintaxis
Elegir sintaxis
Ignorar
Transformar texto
Ir al primer cambio
Editar entrada
Diffchecker Desktop
La forma más segura de usar Diffchecker. ¡Obtén la app de Diffchecker Desktop: tus diffs nunca salen de tu computadora!
Obtener Desktop
Untitled diff
Creado
hace 11 años
El diff nunca expira
Borrar
Exportar
Compartir
Explicar
38 eliminaciones
Líneas
Total
Eliminado
Caracteres
Total
Eliminado
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
112 líneas
Copiar todo
23 adiciones
Líneas
Total
Añadido
Caracteres
Total
Añadido
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
91 líneas
Copiar todo
Copiar
Copiado
Copiar
Copiado
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--;
Copiar
Copiado
Copiar
Copiado
$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;
Copiar
Copiado
Copiar
Copiado
$
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');
}
}
Copiar
Copiado
Copiar
Copiado
$
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;
Copiar
Copiado
Copiar
Copiado
$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');
}
}
Copiar
Copiado
Copiar
Copiado
$
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));
}
}
Copiar
Copiado
Copiar
Copiado
$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;
Copiar
Copiado
Copiar
Copiado
$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');
}
}
Copiar
Copiado
Copiar
Copiado
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
;
}
}
Diferencias guardadas
Texto original
Abrir archivo
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; }
Texto modificado
Abrir archivo
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; }
Encontrar la diferencia