Понимаете функций много, на пример вот такая задача:
Нужно написать следующую строку в PDF-файле: "Привет, это пример как реализовать нижний индекс у числа 23
2 через класс FPDF"
Код будет следующий:
<?php
$pdf->Write(0, 'Привет, это пример как реализовать нижний индекс у числа 23');
$pdf->SubWrite(0,'2','',6,-3);
$pdf->Write(0, ' через класс FPDF');
?>
и таких функций много, которые можно было бы чтоб они в одну строку писались....так что решить проблему с WriteSymbol поковырясь в функции, это не решить проблему в целом.
Но вот код функции Write из класса
<?php
function Write($h, $txt, $link='')
{
//Output text in flowing mode
$cw=&$this->CurrentFont['cw'];
$w=$this->w-$this->rMargin-$this->x;
$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
$s=str_replace("\r",'',$txt);
$nb=strlen($s);
$sep=-1;
$i=0;
$j=0;
$l=0;
$nl=1;
while($i<$nb)
{
//Get next character
$c=$s[$i];
if($c=="\n")
{
//Explicit line break
$this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
$i++;
$sep=-1;
$j=$i;
$l=0;
if($nl==1)
{
$this->x=$this->lMargin;
$w=$this->w-$this->rMargin-$this->x;
$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
}
$nl++;
continue;
}
if($c==' ')
$sep=$i;
$l+=$cw[$c];
if($l>$wmax)
{
//Automatic line break
if($sep==-1)
{
if($this->x>$this->lMargin)
{
//Move to next line
$this->x=$this->lMargin;
$this->y+=$h;
$w=$this->w-$this->rMargin-$this->x;
$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
$i++;
$nl++;
continue;
}
if($i==$j)
$i++;
$this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
}
else
{
$this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
$i=$sep+1;
}
$sep=-1;
$j=$i;
$l=0;
if($nl==1)
{
$this->x=$this->lMargin;
$w=$this->w-$this->rMargin-$this->x;
$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
}
$nl++;
}
else
$i++;
}
//Last chunk
if($i!=$j)
$this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
}
?>
и SubWrite
<?php
function subWrite($h, $txt, $link='', $subFontSize=12, $subOffset=0)
{
// resize font
$subFontSizeold = $this->FontSizePt;
$this->SetFontSize($subFontSize);
// reposition y
$subOffset = ((($subFontSize - $subFontSizeold) / $this->k) * 0.3) + ($subOffset / $this->k);
$subX = $this->x;
$subY = $this->y;
$this->SetXY($subX, $subY - $subOffset);
//Output text
$this->Write($h, $txt, $link);
// restore y position
$subX = $this->x;
$subY = $this->y;
$this->SetXY($subX, $subY + $subOffset);
// restore font size
$this->SetFontSize($subFontSizeold);
}
оф сайт
http://fpdf.org/