+
+ Cineblog by Spipu
+ HTML2PDF
+ Lambda Finder
+ Gestion des Opens - Yaronet
+ A propos de moi
+ Programmes by Spipu
+ Mobile Velib Search
+
+
diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/_LGPL.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/_LGPL.txt
new file mode 100644
index 0000000000..e8bec28dfa
--- /dev/null
+++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/_LGPL.txt
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
1. What's exactly the license of FPDF? Are there any usage restrictions?
+FPDF is released under a permissive license: there is no usage restriction. You may embed it +freely in your application (commercial or not), with or without modifications. +2. When I try to create a PDF, a lot of weird characters show on the screen. Why?
+These "weird" characters are in fact the actual content of your PDF. This behavior is a bug of +IE6. When it first receives an HTML page, then a PDF from the same URL, it displays it directly +without launching Acrobat. This happens frequently during the development stage: on the least +script error, an HTML page is sent, and after correction, the PDF arrives. +3. I try to generate a PDF and IE displays a blank page. What happens?
+First of all, check that you send nothing to the browser after the PDF (not even a space or a +carriage return). You can put an exit statement just after the call to the Output() method to +be sure. If it still doesn't work, it means you're a victim of the "blank page syndrome". IE +used in conjunction with the Acrobat plug-in suffers from many bugs. To avoid these problems +in a reliable manner, two main techniques exist: +//Determine a temporary file name in the current directory
+$file = basename(tempnam('.', 'tmp'));
+rename($file, $file.'.pdf');
+$file .= '.pdf';
+//Save PDF to file
+$pdf->Output($file, 'F');
+//Redirect
+header('Location: '.$file);
+function CleanFiles($dir)
+{
+ //Delete temporary files
+ $t = time();
+ $h = opendir($dir);
+ while($file=readdir($h))
+ {
+ if(substr($file,0,3)=='tmp' and substr($file,-4)=='.pdf')
+ {
+ $path = $dir.'/'.$file;
+ if($t-filemtime($path)>3600)
+ @unlink($path);
+ }
+ }
+ closedir($h);
+}
+4. I can't make line breaks work. I put \n in the string printed by MultiCell but it doesn't work.
+You have to enclose your string with double quotes, not single ones. +5. I try to display a variable in the Header method but nothing prints.
+You have to use theglobal keyword to access global variables, for example:
+function Header()
+{
+ global $title;
+
+ $this->SetFont('Arial', 'B', 15);
+ $this->Cell(0, 10, $title, 1, 1, 'C');
+}
+
+$title = 'My title';
+function Header()
+{
+ $this->SetFont('Arial', 'B', 15);
+ $this->Cell(0, 10, $this->title, 1, 1, 'C');
+}
+
+$pdf->title = 'My title';
+6. I defined the Header and Footer methods in my PDF class but nothing appears.
+You have to create an object from the PDF class, not FPDF: +$pdf = new PDF();
+7. Accented characters are replaced by some strange characters like é.
+Don't use UTF-8 encoding. Standard FPDF fonts use ISO-8859-1 or Windows-1252. +It is possible to perform a conversion to ISO-8859-1 with utf8_decode(): +$str = utf8_decode($str);
+$str = iconv('UTF-8', 'windows-1252', $str);
+8. I try to display the Euro symbol but it doesn't work.
+The standard fonts have the Euro character at position 128. You can define a constant like this +for convenience: +define('EURO', chr(128));
+9. I get the following error when I try to generate a PDF: Some data has already been output, can't send PDF file
+You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return. +You may have this other message just before:ob_end_clean();
+10. I draw a frame with very precise dimensions, but when printed I notice some differences.
+To respect dimensions, select "None" for the Page Scaling setting instead of "Shrink to Printable Area" in the print dialog box. +11. I'd like to use the whole surface of the page, but when printed I always have some margins. How can I get rid of them?
+Printers have physical margins (different depending on the models); it is therefore impossible to remove +them and print on the whole surface of the paper. +12. How can I put a background in my PDF?
+For a picture, call Image() in the Header() method, before any other output. To set a background color, use Rect(). +13. How can I set a specific header or footer on the first page?
+Simply test the page number: +function Header()
+{
+ if($this->PageNo()==1)
+ {
+ //First page
+ ...
+ }
+ else
+ {
+ //Other pages
+ ...
+ }
+}
+14. I'd like to use extensions provided by different scripts. How can I combine them?
+Use an inheritance chain. If you have two classes, say A in a.php: +require('fpdf.php');
+
+class A extends FPDF
+{
+...
+}
+require('fpdf.php');
+
+class B extends FPDF
+{
+...
+}
+require('a.php');
+
+class B extends A
+{
+...
+}
+require('b.php');
+
+class PDF extends B
+{
+...
+}
+
+$pdf = new PDF();
+15. How can I send the PDF by email?
+As any other file, but an easy way is to use PHPMailer and +its in-memory attachment: +$mail = new PHPMailer();
+...
+$doc = $pdf->Output('', 'S');
+$mail->AddStringAttachment($doc, 'doc.pdf', 'base64', 'application/pdf');
+$mail->Send();
+16. What's the limit of the file sizes I can generate with FPDF?
+There is no particular limit. There are some constraints, however: +17. Can I modify a PDF with FPDF?
+It is possible to import pages from an existing PDF document thanks to the FPDI extension:18. I'd like to make a search engine in PHP and index PDF files. Can I do it with FPDF?
+No. But a GPL C utility does exist, pdftotext, which is able to extract the textual content from +a PDF. It is provided with the Xpdf package:19. Can I convert an HTML page to PDF with FPDF?
+Not real-world pages. But a GPL C utility does exist, htmldoc, which allows to do it and gives good results:20. Can I concatenate PDF files with FPDF?
+Not directly, but it is possible to use FPDI +to perform this task. Some free command-line tools also exist:boolean AcceptPageBreak()
+class PDF extends FPDF
+{
+var $col=0;
+
+function SetCol($col)
+{
+ //Move position to a column
+ $this->col=$col;
+ $x=10+$col*65;
+ $this->SetLeftMargin($x);
+ $this->SetX($x);
+}
+
+function AcceptPageBreak()
+{
+ if($this->col<2)
+ {
+ //Go to next column
+ $this->SetCol($this->col+1);
+ $this->SetY(10);
+ return false;
+ }
+ else
+ {
+ //Go back to first column and issue page break
+ $this->SetCol(0);
+ return true;
+ }
+}
+}
+
+$pdf=new PDF();
+$pdf->AddPage();
+$pdf->SetFont('Arial','',12);
+for($i=1;$i<=300;$i++)
+ $pdf->Cell(0,5,"Line $i",0,1);
+$pdf->Output();
+AddFont(string family [, string style [, string file]])
+familystyleB: boldI: italicBI or IB: bold italicfile$pdf->AddFont('Comic','I');
+$pdf->AddFont('Comic','I','comici.php');
+int AddLink()
+AddPage([string orientation ,[ mixed format]])
+orientationP or PortraitL or LandscapeformatA3A4A5LetterLegalAliasNbPages([string alias])
+alias{nb}.
+class PDF extends FPDF
+{
+function Footer()
+{
+ //Go to 1.5 cm from bottom
+ $this->SetY(-15);
+ //Select Arial italic 8
+ $this->SetFont('Arial','I',8);
+ //Print current and total page numbers
+ $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
+}
+}
+
+$pdf=new PDF();
+$pdf->AliasNbPages();
+Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [, boolean fill [, mixed link]]]]]]])
+w0, the cell extends up to the right margin.
+h0.
+txtborder0: no border1: frameL: leftT: topR: rightB: bottom0.
+ln0: to the right1: to the beginning of the next line2: below1 is equivalent to putting 0 and calling Ln() just after.
+Default value: 0.
+alignL or empty string: left align (default value)C: centerR: right alignfilltrue) or transparent (false).
+Default value: false.
+link//Set font
+$pdf->SetFont('Arial','B',16);
+//Move to 8 cm to the right
+$pdf->Cell(80);
+//Centered text in a framed 20*10 mm cell and line break
+$pdf->Cell(20,10,'Title',1,1,'C');
+Close()
+Error(string msg)
+msgFooter()
+class PDF extends FPDF
+{
+function Footer()
+{
+ //Go to 1.5 cm from bottom
+ $this->SetY(-15);
+ //Select Arial italic 8
+ $this->SetFont('Arial','I',8);
+ //Print centered page number
+ $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
+}
+}
+FPDF([string orientation [, string unit [, mixed format]]])
+orientationP or PortraitL or LandscapeP.
+unitpt: pointmm: millimetercm: centimeterin: inchmm.
+formatA3A4A5LetterLegalunit).A4.
+$pdf = new FPDF('P', 'mm', array(100,150));
+float GetStringWidth(string s)
+sfloat GetX()
+float GetY()
+Header()
+class PDF extends FPDF
+{
+function Header()
+{
+ //Select Arial bold 15
+ $this->SetFont('Arial','B',15);
+ //Move to the right
+ $this->Cell(80);
+ //Framed title
+ $this->Cell(30,10,'Title',1,0,'C');
+ //Line break
+ $this->Ln(20);
+}
+}
+Image(string file [, float x [, float y [, float w [, float h [, string type [, mixed link]]]]]])
+filexnull, the current abscissa
+is used.
+ynull, the current ordinate
+is used; moreover, a page break is triggered first if necessary (in case automatic page breaking is enabled)
+and, after the call, the current ordinate is moved to the bottom of the image.
+whtypeJPG, JPEG, PNG and GIF.
+If not specified, the type is inferred from the file extension.
+linkLine(float x1, float y1, float x2, float y2)
+x1y1x2y2Link(float x, float y, float w, float h, mixed link)
+xywhlinkLn([float h])
+hMultiCell(float w, float h, string txt [, mixed border [, string align [, boolean fill]]])
+w0, they extend up to the right margin of the page.
+htxtborder0: no border1: frameL: leftT: topR: rightB: bottom0.
+alignL: left alignmentC: centerR: right alignmentJ: justification (default value)filltrue) or transparent (false).
+Default value: false.
+string Output([string name, string dest])
+nameI) with the name doc.pdf.
+destI: send the file inline to the browser. The plug-in is used if available.
+The name given by name is used when one selects the "Save as" option on the
+link generating the PDF.D: send to the browser and force a file download with the name given by
+name.F: save to a local file with the name given by name (may include a path).S: return the document as a string. name is ignored.int PageNo()
+Rect(float x, float y, float w, float h [, string style])
+xywhstyleD or empty string: draw. This is the default value.F: fillDF or FD: draw and fillSetAuthor(string author [, boolean isUTF8])
+authorisUTF8false) or UTF-8 (true).false.
+SetAutoPageBreak(boolean auto [, float margin])
+automarginSetCompression(boolean compress)
+compressSetCreator(string creator [, boolean isUTF8])
+creatorisUTF8false) or UTF-8 (true).false.
+SetDisplayMode(mixed zoom [, string layout])
+zoomfullpage: displays the entire page on screenfullwidth: uses maximum width of windowreal: uses real size (equivalent to 100% zoom)default: uses viewer default modelayoutsingle: displays one page at oncecontinuous: displays pages continuouslytwo: displays two pages on two columnsdefault: uses viewer default modecontinuous.
+SetDrawColor(int r [, int g, int b])
+rg et b are given, red component; if not, indicates the gray level.
+Value between 0 and 255.
+gbSetFillColor(int r [, int g, int b])
+rg and b are given, red component; if not, indicates the gray level.
+Value between 0 and 255.
+gbSetFont(string family [, string style [, float size]])
+FPDF_FONTPATH constant (if this constant is defined)font directory located in the directory containing fpdf.php (if it exists)include()FPDF_FONTPATH (note the mandatory trailing slash):
+define('FPDF_FONTPATH','/home/www/font/');
+require('fpdf.php');
+familyCourier (fixed-width)Helvetica or Arial (synonymous; sans serif)Times (serif)Symbol (symbolic)ZapfDingbats (symbolic)styleB: boldI: italicU: underlineSymbol and ZapfDingbats.
+size//Times regular 12
+$pdf->SetFont('Times');
+//Arial bold 14
+$pdf->SetFont('Arial','B',14);
+//Removes bold
+$pdf->SetFont('');
+//Times bold, italic and underlined 14
+$pdf->SetFont('Times','BIU');
+SetFontSize(float size)
+sizeSetKeywords(string keywords [, boolean isUTF8])
+keywordsisUTF8false) or UTF-8 (true).false.
+SetLeftMargin(float margin)
+marginSetLineWidth(float width)
+widthSetLink(int link [, float y [, int page]])
+linky-1 indicates the current position.
+The default value is 0 (top of page).
+page-1 indicates the current page. This is the default value.
+SetMargins(float left, float top [, float right])
+lefttoprightSetRightMargin(float margin)
+marginSetSubject(string subject [, boolean isUTF8])
+subjectisUTF8false) or UTF-8 (true).false.
+SetTextColor(int r [, int g, int b])
+rg et b are given, red component; if not, indicates the gray level.
+Value between 0 and 255.
+gbSetTitle(string title [, boolean isUTF8])
+titleisUTF8false) or UTF-8 (true).false.
+SetTopMargin(float margin)
+marginSetX(float x)
+xSetXY(float x, float y)
+xySetY(float y)
+yText(float x, float y, string txt)
+xytxtWrite(float h, string txt [, mixed link])
+htxtlink//Begin with regular font
+$pdf->SetFont('Arial','',14);
+$pdf->Write(5,'Visit ');
+//Then put a blue underlined link
+$pdf->SetTextColor(0,0,255);
+$pdf->SetFont('','U');
+$pdf->Write(5,'www.fpdf.org','http://www.fpdf.org');
+The different examples rapidly show how to use FPDF. You will find all main features explained.
+<?php
+require('fpdf.php');
+
+$pdf=new FPDF();
+$pdf->AddPage();
+$pdf->SetFont('Arial','B',16);
+$pdf->Cell(40,10,'Hello World!');
+$pdf->Output();
+?>
+$pdf=new FPDF('P','mm','A4');
+
+L), other page formats (such as Letter and
+Legal) and units of measure (pt, cm, in).
+$pdf->SetFont('Arial','B',16);
+
+$pdf->Cell(40,10,'Hello World !',1);
+
+$pdf->Cell(60,10,'Powered by FPDF.',0,1,'C');
+
+<?php
+require('fpdf.php');
+
+class PDF extends FPDF
+{
+//Page header
+function Header()
+{
+ //Logo
+ $this->Image('logo_pb.png',10,8,33);
+ //Arial bold 15
+ $this->SetFont('Arial','B',15);
+ //Move to the right
+ $this->Cell(80);
+ //Title
+ $this->Cell(30,10,'Title',1,0,'C');
+ //Line break
+ $this->Ln(20);
+}
+
+//Page footer
+function Footer()
+{
+ //Position at 1.5 cm from bottom
+ $this->SetY(-15);
+ //Arial italic 8
+ $this->SetFont('Arial','I',8);
+ //Page number
+ $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
+}
+}
+
+//Instanciation of inherited class
+$pdf=new PDF();
+$pdf->AliasNbPages();
+$pdf->AddPage();
+$pdf->SetFont('Times','',12);
+for($i=1;$i<=40;$i++)
+ $pdf->Cell(0,10,'Printing line number '.$i,0,1);
+$pdf->Output();
+?>
+{nb} which will be substituted on document closure
+(provided you first called AliasNbPages()).
+<?php
+require('fpdf.php');
+
+class PDF extends FPDF
+{
+function Header()
+{
+ global $title;
+
+ //Arial bold 15
+ $this->SetFont('Arial','B',15);
+ //Calculate width of title and position
+ $w=$this->GetStringWidth($title)+6;
+ $this->SetX((210-$w)/2);
+ //Colors of frame, background and text
+ $this->SetDrawColor(0,80,180);
+ $this->SetFillColor(230,230,0);
+ $this->SetTextColor(220,50,50);
+ //Thickness of frame (1 mm)
+ $this->SetLineWidth(1);
+ //Title
+ $this->Cell($w,9,$title,1,1,'C',true);
+ //Line break
+ $this->Ln(10);
+}
+
+function Footer()
+{
+ //Position at 1.5 cm from bottom
+ $this->SetY(-15);
+ //Arial italic 8
+ $this->SetFont('Arial','I',8);
+ //Text color in gray
+ $this->SetTextColor(128);
+ //Page number
+ $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
+}
+
+function ChapterTitle($num,$label)
+{
+ //Arial 12
+ $this->SetFont('Arial','',12);
+ //Background color
+ $this->SetFillColor(200,220,255);
+ //Title
+ $this->Cell(0,6,"Chapter $num : $label",0,1,'L',true);
+ //Line break
+ $this->Ln(4);
+}
+
+function ChapterBody($file)
+{
+ //Read text file
+ $f=fopen($file,'r');
+ $txt=fread($f,filesize($file));
+ fclose($f);
+ //Times 12
+ $this->SetFont('Times','',12);
+ //Output justified text
+ $this->MultiCell(0,5,$txt);
+ //Line break
+ $this->Ln();
+ //Mention in italics
+ $this->SetFont('','I');
+ $this->Cell(0,5,'(end of excerpt)');
+}
+
+function PrintChapter($num,$title,$file)
+{
+ $this->AddPage();
+ $this->ChapterTitle($num,$title);
+ $this->ChapterBody($file);
+}
+}
+
+$pdf=new PDF();
+$title='20000 Leagues Under the Seas';
+$pdf->SetTitle($title);
+$pdf->SetAuthor('Jules Verne');
+$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
+$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
+$pdf->Output();
+?>
+true indicates that the background must
+be filled).
+<?php
+require('fpdf.php');
+
+class PDF extends FPDF
+{
+//Current column
+var $col=0;
+//Ordinate of column start
+var $y0;
+
+function Header()
+{
+ //Page header
+ global $title;
+
+ $this->SetFont('Arial','B',15);
+ $w=$this->GetStringWidth($title)+6;
+ $this->SetX((210-$w)/2);
+ $this->SetDrawColor(0,80,180);
+ $this->SetFillColor(230,230,0);
+ $this->SetTextColor(220,50,50);
+ $this->SetLineWidth(1);
+ $this->Cell($w,9,$title,1,1,'C',true);
+ $this->Ln(10);
+ //Save ordinate
+ $this->y0=$this->GetY();
+}
+
+function Footer()
+{
+ //Page footer
+ $this->SetY(-15);
+ $this->SetFont('Arial','I',8);
+ $this->SetTextColor(128);
+ $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
+}
+
+function SetCol($col)
+{
+ //Set position at a given column
+ $this->col=$col;
+ $x=10+$col*65;
+ $this->SetLeftMargin($x);
+ $this->SetX($x);
+}
+
+function AcceptPageBreak()
+{
+ //Method accepting or not automatic page break
+ if($this->col<2)
+ {
+ //Go to next column
+ $this->SetCol($this->col+1);
+ //Set ordinate to top
+ $this->SetY($this->y0);
+ //Keep on page
+ return false;
+ }
+ else
+ {
+ //Go back to first column
+ $this->SetCol(0);
+ //Page break
+ return true;
+ }
+}
+
+function ChapterTitle($num,$label)
+{
+ //Title
+ $this->SetFont('Arial','',12);
+ $this->SetFillColor(200,220,255);
+ $this->Cell(0,6,"Chapter $num : $label",0,1,'L',true);
+ $this->Ln(4);
+ //Save ordinate
+ $this->y0=$this->GetY();
+}
+
+function ChapterBody($file)
+{
+ //Read text file
+ $f=fopen($file,'r');
+ $txt=fread($f,filesize($file));
+ fclose($f);
+ //Font
+ $this->SetFont('Times','',12);
+ //Output text in a 6 cm width column
+ $this->MultiCell(60,5,$txt);
+ $this->Ln();
+ //Mention
+ $this->SetFont('','I');
+ $this->Cell(0,5,'(end of excerpt)');
+ //Go back to first column
+ $this->SetCol(0);
+}
+
+function PrintChapter($num,$title,$file)
+{
+ //Add chapter
+ $this->AddPage();
+ $this->ChapterTitle($num,$title);
+ $this->ChapterBody($file);
+}
+}
+
+$pdf=new PDF();
+$title='20000 Leagues Under the Seas';
+$pdf->SetTitle($title);
+$pdf->SetAuthor('Jules Verne');
+$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
+$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
+$pdf->Output();
+?>
+<?php
+require('fpdf.php');
+
+class PDF extends FPDF
+{
+//Load data
+function LoadData($file)
+{
+ //Read file lines
+ $lines=file($file);
+ $data=array();
+ foreach($lines as $line)
+ $data[]=explode(';',chop($line));
+ return $data;
+}
+
+//Simple table
+function BasicTable($header,$data)
+{
+ //Header
+ foreach($header as $col)
+ $this->Cell(40,7,$col,1);
+ $this->Ln();
+ //Data
+ foreach($data as $row)
+ {
+ foreach($row as $col)
+ $this->Cell(40,6,$col,1);
+ $this->Ln();
+ }
+}
+
+//Better table
+function ImprovedTable($header,$data)
+{
+ //Column widths
+ $w=array(40,35,40,45);
+ //Header
+ for($i=0;$i<count($header);$i++)
+ $this->Cell($w[$i],7,$header[$i],1,0,'C');
+ $this->Ln();
+ //Data
+ foreach($data as $row)
+ {
+ $this->Cell($w[0],6,$row[0],'LR');
+ $this->Cell($w[1],6,$row[1],'LR');
+ $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');
+ $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');
+ $this->Ln();
+ }
+ //Closure line
+ $this->Cell(array_sum($w),0,'','T');
+}
+
+//Colored table
+function FancyTable($header,$data)
+{
+ //Colors, line width and bold font
+ $this->SetFillColor(255,0,0);
+ $this->SetTextColor(255);
+ $this->SetDrawColor(128,0,0);
+ $this->SetLineWidth(.3);
+ $this->SetFont('','B');
+ //Header
+ $w=array(40,35,40,45);
+ for($i=0;$i<count($header);$i++)
+ $this->Cell($w[$i],7,$header[$i],1,0,'C',true);
+ $this->Ln();
+ //Color and font restoration
+ $this->SetFillColor(224,235,255);
+ $this->SetTextColor(0);
+ $this->SetFont('');
+ //Data
+ $fill=false;
+ foreach($data as $row)
+ {
+ $this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);
+ $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);
+ $this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);
+ $this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);
+ $this->Ln();
+ $fill=!$fill;
+ }
+ $this->Cell(array_sum($w),0,'','T');
+}
+}
+
+$pdf=new PDF();
+//Column titles
+$header=array('Country','Capital','Area (sq km)','Pop. (thousands)');
+//Data loading
+$data=$pdf->LoadData('countries.txt');
+$pdf->SetFont('Arial','',14);
+$pdf->AddPage();
+$pdf->BasicTable($header,$data);
+$pdf->AddPage();
+$pdf->ImprovedTable($header,$data);
+$pdf->AddPage();
+$pdf->FancyTable($header,$data);
+$pdf->Output();
+?>
+border parameter of the Cell() method, which specifies which sides of the
+cell must be drawn. Here we want the left (L) and right (R) ones. It remains
+the problem of the horizontal line to finish the table. There are two possibilities: either
+check for the last line in the loop, in which case we use LRB for the border
+parameter; or, as done here, add the line once the loop is over.
+<?php
+require('fpdf.php');
+
+class PDF extends FPDF
+{
+var $B;
+var $I;
+var $U;
+var $HREF;
+
+function PDF($orientation='P',$unit='mm',$format='A4')
+{
+ //Call parent constructor
+ $this->FPDF($orientation,$unit,$format);
+ //Initialization
+ $this->B=0;
+ $this->I=0;
+ $this->U=0;
+ $this->HREF='';
+}
+
+function WriteHTML($html)
+{
+ //HTML parser
+ $html=str_replace("\n",' ',$html);
+ $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
+ foreach($a as $i=>$e)
+ {
+ if($i%2==0)
+ {
+ //Text
+ if($this->HREF)
+ $this->PutLink($this->HREF,$e);
+ else
+ $this->Write(5,$e);
+ }
+ else
+ {
+ //Tag
+ if($e{0}=='/')
+ $this->CloseTag(strtoupper(substr($e,1)));
+ else
+ {
+ //Extract attributes
+ $a2=explode(' ',$e);
+ $tag=strtoupper(array_shift($a2));
+ $attr=array();
+ foreach($a2 as $v)
+ {
+ if(preg_match('/([^=]*)=["\']?([^"\']*)/',$v,$a3))
+ $attr[strtoupper($a3[1])]=$a3[2];
+ }
+ $this->OpenTag($tag,$attr);
+ }
+ }
+ }
+}
+
+function OpenTag($tag,$attr)
+{
+ //Opening tag
+ if($tag=='B' or $tag=='I' or $tag=='U')
+ $this->SetStyle($tag,true);
+ if($tag=='A')
+ $this->HREF=$attr['HREF'];
+ if($tag=='BR')
+ $this->Ln(5);
+}
+
+function CloseTag($tag)
+{
+ //Closing tag
+ if($tag=='B' or $tag=='I' or $tag=='U')
+ $this->SetStyle($tag,false);
+ if($tag=='A')
+ $this->HREF='';
+}
+
+function SetStyle($tag,$enable)
+{
+ //Modify style and select corresponding font
+ $this->$tag+=($enable ? 1 : -1);
+ $style='';
+ foreach(array('B','I','U') as $s)
+ if($this->$s>0)
+ $style.=$s;
+ $this->SetFont('',$style);
+}
+
+function PutLink($URL,$txt)
+{
+ //Put a hyperlink
+ $this->SetTextColor(0,0,255);
+ $this->SetStyle('U',true);
+ $this->Write(5,$txt,$URL);
+ $this->SetStyle('U',false);
+ $this->SetTextColor(0);
+}
+}
+
+$html='You can now easily print text mixing different styles: <b>bold</b>, <i>italic</i>,
+<u>underlined</u>, or <b><i><u>all at once</u></i></b>!<br><br>You can also insert links on
+text, such as <a href="http://www.fpdf.org">www.fpdf.org</a>, or on an image: click on the logo.';
+
+$pdf=new PDF();
+//First page
+$pdf->AddPage();
+$pdf->SetFont('Arial','',20);
+$pdf->Write(5,'To find out what\'s new in this tutorial, click ');
+$pdf->SetFont('','U');
+$link=$pdf->AddLink();
+$pdf->Write(5,'here',$link);
+$pdf->SetFont('');
+//Second page
+$pdf->AddPage();
+$pdf->SetLink($link);
+$pdf->Image('logo.png',10,12,30,0,'','http://www.fpdf.org');
+$pdf->SetLeftMargin(45);
+$pdf->SetFontSize(14);
+$pdf->WriteHTML($html);
+$pdf->Output();
+?>
+MakeFont(string fontfile, string afmfile [, string enc [, array patch [, string type]]])
+fontfilePath to the .ttf or .pfb file.
+afmfilePath to the .afm file.
+encName of the encoding to use. Default value: cp1252.
patchOptional modification of the encoding. Empty by default.
+typeType of the font (TrueType or Type1). Default value: TrueType.
type parameter.
+array(164=>'Euro').
+$file
+in the .php file accordingly.
+MakeFont('c:\\windows\\fonts\\comic.ttf','comic.afm','cp1252');
+
+$pdf->AddFont('Comic','','comic.php');
+
+$pdf->AddFont('Comic');
+
+$pdf->AddFont('Comic','B','comicbd.php');
+
+<?php
+require('font/makefont/makefont.php');
+
+MakeFont('calligra.ttf','calligra.afm');
+?>
+<?php
+require('fpdf.php');
+
+$pdf=new FPDF();
+$pdf->AddFont('Calligrapher','','calligra.php');
+$pdf->AddPage();
+$pdf->SetFont('Calligrapher','',35);
+$pdf->Cell(0,10,'Enjoy new fonts with FPDF!');
+$pdf->Output();
+?>
+| Encoding | Position |
|---|---|
| cp1250 | 128 |
| cp1251 | 136 |
| cp1252 | 128 |
| cp1253 | 128 |
| cp1254 | 128 |
| cp1255 | 128 |
| cp1257 | 128 |
| cp1258 | 128 |
| cp874 | 128 |
| ISO-8859-1 | absent |
| ISO-8859-2 | absent |
| ISO-8859-4 | absent |
| ISO-8859-5 | absent |
| ISO-8859-7 | absent |
| ISO-8859-9 | absent |
| ISO-8859-11 | absent |
| ISO-8859-15 | 164 |
| ISO-8859-16 | 164 |
| KOI8-R | absent |
| KOI8-U | absent |
$name a comma followed by the desired style
+(Italic, Bold or BoldItalic)$name='ComicSansMS,Italic';
+$pdf->AddFont('Comic','I','comici.php');
+
+; ?>/res/exemple09.png.php?px=5&py=20)
| + A propos de ... + | ++ HTML2PDF v + | +
| + http://html2pdf.fr/ + | ++ page [[page_cu]]/[[page_nb]] + | ++ ©Spipu 2008-2009 + | +
+ 
+
|
+
+
|
+
+
|
+
+
|
+

| Test 1 |
| Test 2 |
+
|
+ A2 | +AAAAAAAA | +|||||
| B1 | +
+
|
+ ||||||
| B2 | +A2 | +
![]() |
+





| Largeur : 150px |
| Largeur : 150pt |
| Largeur : 100mm |
| Largeur : 5in |
| Largeur : 80% |
| Coucou ! ceci est un border solid avec un radius !!! |
| Coucou ! ceci est un background avec un radius !!! |
| Coucou ! ceci est un border solid |
| Coucou ! ceci est un border dotted |
| Coucou ! ceci est un border dashed |
| Case A1 | +Case A2 | +Case A3 | +
| Case B1 | +Case B2 test de hr |
+ Case B3 | +
| Case A1 avec tests diverses |
+ Case A2 | +Case A3 classic | +
| Case B1 toto |
+ Case B2 | +Case B3 | +
| X | +O | +X | +
| O | +X | ++ |
| O | ++ | X | +
| + Ceci est un test + | +
| Text gauche avec retour la ligne |
+ ![]() lgende |
+ Texte droite | +
+ texte la suite d'une image, rptitif car besoin d'un retour la ligne
+ texte la suite d'une image, rptitif car besoin d'un retour la ligne
+ texte la suite d'une image, rptitif car besoin d'un retour la ligne
+ texte la suite d'une image, rptitif car besoin d'un retour la ligne| html2pdf | +Test d'header | ++ |
| html2pdf.fr | +page [[page_cu]]/[[page_nb]] | +
| + test de texte assez long pour engendrer des retours la ligne automatique... + a b c d e f g h i j k l m n o p q r s t u v w x y z + a b c d e f g h i j k l m n o p q r s t u v w x y z + | ++ test de texte assez long pour engendrer des retours la ligne automatique... + a b c d e f g h i j k l m n o p q r s t u v w x y z + a b c d e f g h i j k l m n o p q r s t u v w x y z + + | +
| + test de texte assez long pour engendrer des retours la ligne automatique... + a b c d e f g h i j k l m n o p q r s t u v w x y z + a b c d e f g h i j k l m n o p q r s t u v w x y z + | ++ test de texte assez long pour engendrer des retours la ligne automatique... + a b c d e f g h i j k l m n o p q r s t u v w x y z + a b c d e f g h i j k l m n o p q r s t u v w x y z + + | +
| AAA | +BBB | +CCC | +
| AAA | +BBB | +CCC | +
| AAA | +BBB | +CCC | +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum, nibh eu ultricies scelerisque, est lorem dignissim elit, quis tempus tortor eros non ipsum. Mauris convallis augue ac sapien. In scelerisque dignissim elit. Donec consequat semper lectus. Sed in quam. Nunc molestie hendrerit ipsum. Curabitur elit risus, rhoncus ut, mattis a, convallis eu, neque. Morbi luctus est sit amet nunc. In nisl. Donec magna libero, aliquet eu, vestibulum ut, mollis sed, felis.
+ | AAA | +BBB | +CCC | +
| AAA | +BBB | +CCC | +
| AAA | +BBB | +CCC | +
| n | ++ Titre du tableau + | +||
|---|---|---|---|
| Colonne 1 | +Colonne 2 | +Colonne 3 | +|
| + | test de texte assez long pour engendrer des retours la ligne automatique... | +test de texte assez long pour engendrer des retours la ligne automatique... | +test de texte assez long pour engendrer des retours la ligne automatique... | +
| + bas du tableau + | +|||
| Ceci est un | +test de style | +
| Ceci est un | +test de style | +
| + | +
+ ![]() + RELATION CLIENT + |
+
| + | Client : | +M. Albert Dupont | +
| + | Adresse : | +
+ Rsidence perdue + 1, rue sans nom + 00 000 - Pas de Ville + |
+
| + | Email : | +nomail@domain.com | +
| + | Tel : | +33 (0) 1 00 00 00 00 | +
| + | Spipu Ville, le | +
| Produit | +Dsignation | +Prix Unitaire | +Quantit | +Prix Net | +
|---|
| + | + | € | ++ | € | +
| Total : | +€ | +
|---|
| + |
+ Mle Jesuis CELIBATAIRE + Service Relation Client + Tel : 33 (0) 1 00 00 00 00 + Email : on_va@chez.moi + |
+
+
+ |
+
+ + ACCORD DE RETOUR + |
+ + | +
+
+ |
+ + |
+
+ |
+ + | |||||||||||||||||||||||||||||||||||||
+
+
+
|
+ + |
+
+
+ + A COLLER IMPERATIVEMENT SUR LES COLIS + |
+ + | |||||||||||||||||||||||||||||||||||||
| a A1 | +aa A2 | +aaa A3 | +aaaa A4 | +
| B1 | +B2 | +B3 | +|
| C1 | +C2 | +C3 | +|
| D1 | +D2 | +||
| CoucouCoucou ! | +B | +CC | +|
| AA | +CoucouCoucou ! | +CC | +|
| AA | +B | +CoucouCoucou ! | +|
| AA | +AA | +AA | +AA | +
| AA | +CoucouCoucou ! | +||
| AA | +CC | +||
| D1 | +D2 | +||
|
+ + Ligne dans un paragraphe, + test de texte assez long pour engendrer des retours la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z + test de texte assez long pour engendrer des retours la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z + ++ Ligne dans un paragraphe, + test de texte assez long pour engendrer des retours la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z + test de texte assez long pour engendrer des retours la ligne automatique... a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x y z + + |
+ + Test de paragraphe :) + | +
+ 
|
+ Test de TD trs grand, en dsactivant le test de TD ne devant pas depasser une page + via la mthode setTestTdInOnePage. +
|
+
+
|
+
+
|
+
+
|
+
| 0 | a | e | i | o | u |
|---|---|---|---|---|---|
| 1 | à | è | ì | ò | ù |
| 2 | á | é | í | ó | ú |
| 3 | â | ê | î | ô | û |
| 4 | ä | ë | ï | ö | ü |
| 5 | ã | õ | |||
| 6 | å | ||||
| 7 | € | « | ø |
";
+?>
+Table :'.print_r($info, true).'
[[OTHER]]+err05 Codi HTML no vlid, totes les etiquetes han de tenir el seu tancament.
[[OTHER]]+err06 Impossible carregar la imatge [[OTHER]] +err07 El contenido de una etiqueta TD no encaja en una sola pgina +txt01 ERROR n +txt02 Fitxer : +txt03 Lnia : +pdf01 Document generat el [[date_d]]/[[date_m]]/[[date_y]] +pdf02 Document generat a les [[date_h]]:[[date_i]] +pdf03 Document generat el [[date_d]]/[[date_m]]/[[date_y]] a les [[date_h]]:[[date_i]] +pdf04 Pgina [[current]]/[[nb]] +pdf05 Els formularis requereixen l's de l'Adobe Reader 9 +vue01 ENCABEZAR +vue02 PEU DE PGINA +vue03 PGINA +vue04 Visualitzaci diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/de.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/de.txt new file mode 100644 index 0000000000..a241f06195 --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/de.txt @@ -0,0 +1,19 @@ +err01 Das Tag <[[OTHER]]> existiert noch nicht.
[[OTHER]]+err05 Falsches HTML Code, alle Tags sollen geschloen sein.
[[OTHER]]+err06 Ladung des Bilds unmglich [[OTHER]] +err07 Er Inhalt eines TD-Tag passt nicht nur auf einer Seite +txt01 Fehler n +txt02 Datei : +txt03 Linie : +pdf01 Datei aufgebaut am [[date_d]]/[[date_m]]/[[date_y]] +pdf02 Datei aufgebaut um [[date_h]]:[[date_m]] +pdf03 Datei aufgebaut am [[date_d]]/[[date_m]]/[[date_y]] um [[date_h]]:[[date_i]] +pdf04 Seite [[current]]/[[nb]] +pdf05 Die Formulare bentigen Sie den Adobe Reader 9 +vue01 Seite-Header +vue02 Fuzeile +vue03 Seite +vue04 Visualisierung diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/en.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/en.txt new file mode 100644 index 0000000000..ce31fce629 --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/en.txt @@ -0,0 +1,19 @@ +err01 The tag <[[OTHER]]> does not yet exist.
[[OTHER]]+err05 HTML code invalid, all tags must be closed.
[[OTHER]]+err06 Impossible to load the image [[OTHER]] +err07 The content of a TD tag does not fit on only one page +txt01 ERROR n +txt02 File : +txt03 Line : +pdf01 Document generated on [[date_y]]-[[date_m]]-[[date_d]] +pdf02 Document generated at [[date_h]]:[[date_i]] +pdf03 Document generated on [[date_y]]-[[date_m]]-[[date_d]] at [[date_h]]:[[date_i]] +pdf04 Page [[current]]/[[nb]] +pdf05 The forms require the use of Adobe Reader 9 +vue01 HEADER +vue02 FOOTER +vue03 PAGE +vue04 View diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/es.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/es.txt new file mode 100644 index 0000000000..b2bdf7d8ab --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/es.txt @@ -0,0 +1,19 @@ +err01 La etiqueta <[[OTHER]]> todava no existe.
[[OTHER]]+err05 Cdigo HTML no vlido, todas las etiquetas deben tener su cierre.
[[OTHER]]+err06 Imposible cargar la imagen [[OTHER]] +err07 El contenido de una etiqueta TD no encaja en una sola pgina +txt01 ERROR n +txt02 Fichero : +txt03 Lnea : +pdf01 Documento generado el [[date_d]]/[[date_m]]/[[date_y]] +pdf02 Documento generado a las [[date_h]]:[[date_i]] +pdf03 Documento generado el [[date_d]]/[[date_m]]/[[date_y]] a las [[date_h]]:[[date_i]] +pdf04 Pgina [[current]]/[[nb]] +pdf05 Los formularios requieren el uso de Adobe Reader 9 +vue01 ENCABEZADO +vue02 PIE DE PGINA +vue03 PGINA +vue04 Visualizacin diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/fr.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/fr.txt new file mode 100644 index 0000000000..0c9ced6c7e --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/fr.txt @@ -0,0 +1,19 @@ +err01 La balise <[[OTHER]]> n'existe pas encore.
[[OTHER]]+err05 Code HTML non valide, toutes les balises doivent tre fermes.
[[OTHER]]+err06 Impossible de charger l'image [[OTHER]] +err07 le contenu d'une balise TD ne rentre pas sur une seule page +txt01 ERREUR n +txt02 Fichier : +txt03 Ligne : +pdf01 Document gnr le [[date_d]]/[[date_m]]/[[date_y]] +pdf02 Document gnr [[date_h]]:[[date_i]] +pdf03 Document gnr le [[date_d]]/[[date_m]]/[[date_y]] [[date_h]]:[[date_i]] +pdf04 Page [[current]]/[[nb]] +pdf05 Les formulaires ncessitent l'utilisation de Adobe Reader 9 +vue01 HEADER +vue02 FOOTER +vue03 PAGE +vue04 Restitution diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/it.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/it.txt new file mode 100644 index 0000000000..b5c029c45b --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/it.txt @@ -0,0 +1,19 @@ +err01 Il tag <[[OTHER]]> non esiste ancora.
[[OTHER]]+err05 HTML non valido, tutte le tag deve essere chiuso.
[[OTHER]]+err06 Impossibile caricare l'immagine [[OTHER]] +err07 il contenuto di un tag TD non rientra in una sola pagina +txt01 ERRORE n +txt02 File : +txt03 Linea : +pdf01 Documento generato il [[date_d]]/[[date_m]]/[[date_y]] +pdf02 Documento generato [[date_h]]:[[date_i]] +pdf03 Documento generato il [[date_d]]/[[date_m]]/[[date_y]] nel [[date_h]]:[[date_i]] +pdf04 Pagina [[current]]/[[nb]] +pdf05 I moduli richiedono l'uso di Adobe Reader 9 +vue01 HEADER +vue02 FOOTER +vue03 PAGINA +vue04 Visualization diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/nl.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/nl.txt new file mode 100644 index 0000000000..18b82a11d7 --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/nl.txt @@ -0,0 +1,19 @@ +err01 De tag <[[OTHER]]> bestaat nog niet.
[[OTHER]]+err05 Ongeldige HTML code, alle tags dienen te zijn gesloten.
[[OTHER]]+err06 Kan afbeelding niet laden: [[OTHER]] +err07 De inhoud van de cel (
[[OTHER]]+err05 Cdigo HTML no vlido, todas as tags devem ser fechadas.
[[OTHER]]+err06 Impossvel carregar imagem [[OTHER]] +err07 O contedo de uma tag TD no se encaixa em apenas uma pgina +txt01 ERRO n +txt02 Arquivo : +txt03 Linha : +pdf01 Documento generado em [[date_d]]/[[date_m]]/[[date_y]] +pdf02 Documento generado s [[date_h]]:[[date_i]] +pdf03 Documento generado em [[date_d]]/[[date_m]]/[[date_y]] s [[date_h]]:[[date_i]] +pdf04 Pgina [[current]]/[[nb]] +pdf05 Os formulrios exigem a utilizao do Adobe Reader 9 +vue01 CABEALHO +vue02 RODAP +vue03 PGINA +vue04 Visualizao diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/tr.txt b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/tr.txt new file mode 100644 index 0000000000..3a239c7366 --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/langues/tr.txt @@ -0,0 +1,19 @@ +err01 <[[OTHER]]> etiketi bulunamad.
[[OTHER]]+err05 HTML kodu hatal, btn etiketler kapatlmal.
[[OTHER]]+err06 Resim dosyas okunamyor [[OTHER]] +err07 TD ierii bir sayfaya smyor +txt01 HATA n +txt02 Dosya : +txt03 Satr : +pdf01 Dokman retilme tarihi [[date_y]]-[[date_m]]-[[date_d]] +pdf02 Dokman retilme tarihi [[date_h]]:[[date_i]] +pdf03 Dokman retilme tarihi [[date_y]]-[[date_m]]-[[date_d]] saati [[date_h]]:[[date_i]] +pdf04 Sayfa [[current]]/[[nb]] +pdf05 Adobe Reader 9 gerektirir +vue01 DOSYA ST +vue02 DOSYA ALTI +vue03 SAYFA +vue04 Grnm diff --git a/main/inc/lib/html2pdf/html2pdf_v3.22a/parsingHTML.class.php b/main/inc/lib/html2pdf/html2pdf_v3.22a/parsingHTML.class.php new file mode 100644 index 0000000000..3f0274505c --- /dev/null +++ b/main/inc/lib/html2pdf/html2pdf_v3.22a/parsingHTML.class.php @@ -0,0 +1,421 @@ + PDF, utilise fpdf de Olivier PLATHEY + * Distribu sous la licence LGPL. + * + * @author Laurent MINGUET