Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 11 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
38 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
112 lignes
Copier tout
23 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
91 lignes
Copier tout
Copier
Copié
Copier
Copié
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--;
Copier
Copié
Copier
Copié
$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;
Copier
Copié
Copier
Copié
$
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');
}
}
Copier
Copié
Copier
Copié
$
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;
Copier
Copié
Copier
Copié
$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');
}
}
Copier
Copié
Copier
Copié
$
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));
}
}
Copier
Copié
Copier
Copié
$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;
Copier
Copié
Copier
Copié
$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');
}
}
Copier
Copié
Copier
Copié
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
;
}
}
Différences enregistrées
Texte d'origine
Ouvrir un fichier
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; }
Texte modifié
Ouvrir un fichier
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; }
Trouver la différence