PDF Class Reference

Inherits FPDF.

List of all members.

Public Member Functions


Detailed Description

Definition at line 17 of file pdf_output.php.


Member Function Documentation

PDF::_Arc ( x1,
y1,
x2,
y2,
x3,
y3 
)

Definition at line 50 of file pdf_output.php.

Referenced by RoundedRect().

00050                                              {
00051     $h = $this->h;
00052     $this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c ', $x1*$this->k, ($h-$y1)*$this->k,
00053     $x2*$this->k, ($h-$y2)*$this->k, $x3*$this->k, ($h-$y3)*$this->k));
00054   }

PDF::CloseTag ( tag  ) 

Definition at line 138 of file pdf_output.php.

Referenced by WriteHTML().

00138                          {
00139     //Balise fermante
00140     if($tag=='B' || $tag=='I' || $tag=='U') $this->SetStyle($tag,false);
00141     if($tag=='A') $this->HREF='';
00142   }

PDF::Footer (  ) 

Reimplemented from FPDF.

Definition at line 92 of file pdf_output.php.

00092                      {
00093     $y=-17;
00094     $this->SetX(0);
00095     //Arial italic 8
00096     $this->SetFont('Arial','',6);
00097     $this->SetFillColor(255);
00098     foreach(explode("\n",STORE_LEGAL_INFO) as $lg){
00099       $this->SetY($y);
00100       $this->Cell(0,3,tep_correct_entitie_put_pdf($lg),0,0,'C');
00101       $y = $y +3;
00102     }
00103   }

PDF::Header (  ) 

Reimplemented from FPDF.

Definition at line 57 of file pdf_output.php.

00057                    {
00058     global $oID;
00059       $date = strftime('%A, %d %B %Y');
00060     //Logo + link shop
00061       $this->Image(HTTP_SERVER.STORE_LOGO_PRINT,5,10,50,0,'',HTTP_SERVER.DIR_WS_CATALOG);
00062 
00063     // Company Address
00064       $this->SetX(0);
00065       $this->SetY(10);
00066       $this->SetFont('Arial','B',10);
00067       $this->SetTextColor(158,11,14);
00068       $this->Ln(0);
00069       $this->Cell(123);
00070       $this->MultiCell(100, 3.5, tep_correct_entitie_put_pdf(STORE_NAME_ADDRESS),0,'L');
00071 
00072     //email
00073       $this->SetX(0);
00074       $this->SetY(35);
00075       $this->SetFont('Arial','B',10);
00076       $this->SetTextColor(158,11,14);
00077       $this->Ln(0);
00078       $this->Cell(123);
00079       $this->Cell(100, 6, "E-mail: " . STORE_OWNER_EMAIL_ADDRESS,0,'L');
00080 
00081     //website url
00082       $this->SetX(0);
00083       $this->SetY(42);
00084       $this->SetFont('Arial','B',10);
00085       $this->SetTextColor(158,11,14);
00086       $this->Ln(0);
00087       $this->Cell(123);
00088       $this->Cell(100, 6, "Web: " . HTTP_SERVER,0,'L');
00089 
00090   }

PDF::OpenTag ( tag,
attr 
)

Definition at line 131 of file pdf_output.php.

Referenced by WriteHTML().

00131                               {
00132     //Balise ouvrante
00133     if($tag=='B' || $tag=='I' || $tag=='U') $this->SetStyle($tag,true);
00134     if($tag=='A') $this->HREF=$attr['HREF'];
00135     if($tag=='BR') $this->Ln(5);
00136   }

PDF::PutLink ( URL,
txt 
)

Definition at line 154 of file pdf_output.php.

Referenced by WriteHTML().

00154                              {
00155     //Place un hyperlien
00156     $this->SetTextColor(0,0,255);
00157     $this->SetStyle('U',true);
00158     $this->Write(5,$txt,$URL);
00159     $this->SetStyle('U',false);
00160     $this->SetTextColor(0);
00161   }

PDF::RoundedRect ( x,
y,
w,
h,
r,
style = '' 
)

Definition at line 19 of file pdf_output.php.

00019                                                        {
00020     $k = $this->k;
00021     $hp = $this->h;
00022     if($style=='F')
00023         $op='f';
00024     elseif($style=='FD' or $style=='DF')
00025         $op='B';
00026     else
00027         $op='S';
00028     $MyArc = 4/3 * (sqrt(2) - 1);
00029     $this->_out(sprintf('%.2f %.2f m',($x+$r)*$k,($hp-$y)*$k ));
00030     $xc = $x+$w-$r ;
00031     $yc = $y+$r;
00032     $this->_out(sprintf('%.2f %.2f l', $xc*$k,($hp-$y)*$k ));
00033 
00034     $this->_Arc($xc + $r*$MyArc, $yc - $r, $xc + $r, $yc - $r*$MyArc, $xc + $r, $yc);
00035     $xc = $x+$w-$r ;
00036     $yc = $y+$h-$r;
00037     $this->_out(sprintf('%.2f %.2f l',($x+$w)*$k,($hp-$yc)*$k));
00038     $this->_Arc($xc + $r, $yc + $r*$MyArc, $xc + $r*$MyArc, $yc + $r, $xc, $yc + $r);
00039     $xc = $x+$r ;
00040     $yc = $y+$h-$r;
00041     $this->_out(sprintf('%.2f %.2f l',$xc*$k,($hp-($y+$h))*$k));
00042     $this->_Arc($xc - $r*$MyArc, $yc + $r, $xc - $r, $yc + $r*$MyArc, $xc - $r, $yc);
00043     $xc = $x+$r ;
00044     $yc = $y+$r;
00045     $this->_out(sprintf('%.2f %.2f l',($x)*$k,($hp-$yc)*$k ));
00046     $this->_Arc($xc - $r, $yc - $r*$MyArc, $xc - $r*$MyArc, $yc - $r, $xc, $yc - $r);
00047     $this->_out($op);
00048   }

PDF::SetStyle ( tag,
enable 
)

Definition at line 144 of file pdf_output.php.

Referenced by CloseTag(), OpenTag(), and PutLink().

00144                                  {
00145     //Modifie le style et sélectionne la police correspondante
00146     $this->$tag+=($enable ? 1 : -1);
00147     $style='';
00148     foreach(array('B','I','U') as $s)
00149       if(isset($this->$s) && $this->$s >0) $style.=$s;
00150 
00151     $this->SetFont('',$style);
00152   }

PDF::WriteHTML ( html  ) 

Definition at line 105 of file pdf_output.php.

00105                             {
00106     //Parseur HTML
00107     $html=str_replace("\n",' ',$html);
00108     $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
00109     foreach($a as $i=>$e) {
00110       if($i%2==0) {
00111           if(isset($this->HREF))  $this->PutLink($this->HREF,$e);
00112           else $this->Write(5,$e);
00113       }
00114       else {
00115         //Balise
00116         if($e[0]=='/') $this->CloseTag(strtoupper(substr($e,1)));
00117         else {
00118           //Extraction des attributs
00119           $a2=explode(' ',$e);
00120           $tag=strtoupper(array_shift($a2));
00121           $attr=array();
00122           foreach($a2 as $v)
00123               if(preg_match('/([^=]*)=["\']?([^"\']*)/',$v,$a3)) $attr[strtoupper($a3[1])]=$a3[2];
00124 
00125           $this->OpenTag($tag,$attr);
00126         }
00127       }
00128     }
00129   }


The documentation for this class was generated from the following file: