diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 0b9203df4da..26257a05492 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -22,7 +22,7 @@ * \file htdocs/compta/facture/impayees.php * \ingroup facture * \brief Page to list and build liste of unpaid invoices - * \version $Revision: 1.84 $ + * \version $Revision: 1.85 $ */ require("../../main.inc.php"); @@ -52,7 +52,7 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire) { if (is_array($_POST['toGenerate'])) { - require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php"); + require_once(FPDFI_PATH.'fpdi.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php'); $factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('\.pdf|',$_POST['toGenerate']).'\.pdf','\.meta$|\.png','date',SORT_DESC) ; @@ -424,5 +424,5 @@ if ($result) $db->close(); -llxFooter('$Date: 2011/07/31 22:23:13 $ - $Revision: 1.84 $'); +llxFooter('$Date: 2011/08/10 23:21:13 $ - $Revision: 1.85 $'); ?> diff --git a/htdocs/includes/dolibarr_changes.txt b/htdocs/includes/dolibarr_changes.txt index 486f39278c0..8b9ae89d767 100644 --- a/htdocs/includes/dolibarr_changes.txt +++ b/htdocs/includes/dolibarr_changes.txt @@ -23,7 +23,6 @@ Replace call to serialize_val with no bugged value FPDFI and FPDF_TPL: ------------------- -* Added the include FPDF at beginning of fpdf_tpl.php * Replaced all sprintf(%0.2f) by sprintf(%0.2F) (Fix bug) diff --git a/htdocs/includes/fpdf/fpdf/FAQ.htm b/htdocs/includes/fpdf/fpdf/FAQ.htm deleted file mode 100644 index 05d85c6e0e7..00000000000 --- a/htdocs/includes/fpdf/fpdf/FAQ.htm +++ /dev/null @@ -1,341 +0,0 @@ - - -
- -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' && 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. A common -case is having extra blank at the end of an included script file.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:"); //remove all unsupported tags
- //replace carriage returns, newlines and tabs
- $repTable = array("\t" => " ", "\n" => "
", "\r" => " ", "\0" => " ", "\x0B" => " ");
- $html = strtr($html, $repTable);
- $pattern = '/(<[^>]+>)/Uu';
- $a = preg_split($pattern, $html, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); //explodes the string
-
- if (empty($this->lasth)) {
- //set row height
- $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
- }
-
- foreach($a as $key=>$element) {
- $element = str_replace('–','-',$element); //remplace les – par un tiret
- $element = str_replace('’','\'',$element); //remplace les ’ par un apostrophe
- $element = str_replace('"','"',$element); //remplace les " par une guillemet
- $element = str_replace('€',chr(128),$element); //remplace les € par le signe euro
- $element = str_replace('œ',chr(156),$element); //remplace les œ par le signe e dans l'o
- if (!preg_match($pattern, $element)) {
- //Text
- if($this->HREF) {
- $this->addHtmlLink($this->HREF, $element, $fill);
- }
- elseif($this->tdbegin) {
- if((strlen(trim($element)) > 0) AND ($element != " ")) {
- // Cette version ne g�re pas UTF8
- //$this->Cell($this->tdwidth, $this->tdheight, $this->unhtmlentities($element), $this->tableborder, '', $this->tdalign, $this->tdbgcolor);
- $this->Cell($this->tdwidth, $this->tdheight, utf8_decode($this->unhtmlentities($element)), $this->tableborder, '', $this->tdalign, $this->tdbgcolor);
- }
- elseif($element == " ") {
- $this->Cell($this->tdwidth, $this->tdheight, '', $this->tableborder, '', $this->tdalign, $this->tdbgcolor);
- }
- }
- else {
- // cette version ne g�re pas UTF8
- //$this->Write($this->lasth, stripslashes($this->unhtmlentities($element)), '', $fill);
- $this->Write($this->lasth, stripslashes(utf8_decode($this->unhtmlentities($element))), '', $fill);
- }
- }
- else {
- $element = substr($element, 1, -1);
- //Tag
- if($element{0}=='/') {
- $this->closedHTMLTagHandler(strtolower(substr($element, 1)));
- }
- else {
- //Extract attributes
- // get tag name
- preg_match('/([a-zA-Z0-9]*)/', $element, $tag);
- $tag = strtolower($tag[0]);
- // get attributes
- preg_match_all('/([^=\s]*)=["\']?([^"\']*)["\']?/', $element, $attr_array, PREG_PATTERN_ORDER);
- $attr = array(); // reset attribute array
- while(list($id,$name)=each($attr_array[1])) {
- $attr[strtolower($name)] = $attr_array[2][$id];
- }
- $this->openHTMLTagHandler($tag, $attr, $fill);
- }
- }
- }
- if ($ln) {
- $this->Ln($this->lasth);
- }
- }
-
- /**
- * Prints a cell (rectangular area) with optional borders, background color and html text string. The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.
- * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting.
- * @param float $w Cell width. If 0, the cell extends up to the right margin.
- * @param float $h Cell minimum height. The cell extends automatically if needed.
- * @param float $x upper-left corner X coordinate
- * @param float $y upper-left corner Y coordinate
- * @param string $html html text to print. Default value: empty string.
- * @param mixed $border Indicates if borders must be drawn around the cell. The value can be either a number:
or a string containing some or all of the following characters (in any order):
- * @param int $ln Indicates where the current position should go after the call. Possible values are:
- Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0.
- * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
- * @see Cell()
- */
- function writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0) {
-
- if (empty($this->lasth)) {
- //set row height
- $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
- }
-
- if (empty($x)) {
- $x = $this->GetX();
- }
- if (empty($y)) {
- $y = $this->GetY();
- }
-
- // get current page number
- $pagenum = $this->page;
-
- $this->SetX($x);
- $this->SetY($y);
-
- if(empty($w)) {
- $w = $this->w - $x - $this->rMargin;
- }
-
- // store original margin values
- $lMargin = $this->lMargin;
- $rMargin = $this->rMargin;
-
- // set new margin values
- $this->SetLeftMargin($x);
- $this->SetRightMargin($this->w - $x - $w);
-
- // calculate remaining vertical space on page
- $restspace = $this->getPageHeight() - $this->GetY() - $this->getBreakMargin();
-
- $this->writeHTML($html, true, $fill); // write html text
-
- $currentY = $this->GetY();
-
- // check if a new page has been created
- if ($this->page > $pagenum) {
- // design a cell around the text on first page
- $currentpage = $this->page;
- $this->page = $pagenum;
- $this->SetY($this->getPageHeight() - $restspace - $this->getBreakMargin());
- $h = $restspace - 1;
- $this->Cell($w, $h, "", $border, $ln, 'L', 0);
- // design a cell around the text on last page
- $this->page = $currentpage;
- $h = $currentY - $this->tMargin;
- $this->SetY($this->tMargin); // put cursor at the beginning of text
- $this->Cell($w, $h, "", $border, $ln, 'L', 0);
- } else {
- $h = max($h, ($currentY - $y));
- $this->SetY($y); // put cursor at the beginning of text
- // design a cell around the text
- $this->Cell($w, $h, "", $border, $ln, 'L', 0);
- }
-
- // restore original margin values
- $this->SetLeftMargin($lMargin);
- $this->SetRightMargin($rMargin);
-
- if ($ln) {
- $this->Ln(0);
- }
- }
-
- /**
- * Process opening tags.
- * @param string $tag tag name (in uppercase)
- * @param string $attr tag attribute (in uppercase)
- * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
- * @access private
- */
- function openHTMLTagHandler($tag, $attr, $fill=0) {
- //Opening tag
- switch($tag) {
- case 'table': {
- if ((isset($attr['border'])) AND ($attr['border'] != '')) {
- $this->tableborder = $attr['border'];
- }
- else {
- $this->tableborder = 0;
- }
- break;
- }
- case 'tr': {
- break;
- }
- case 'td':
- case 'th': {
- if ((isset($attr['width'])) AND ($attr['width'] != '')) {
- $this->tdwidth = ($attr['width']/4);
- }
- else {
- $this->tdwidth = (($this->w - $this->lMargin - $this->rMargin) / $this->default_table_columns);
- }
- if ((isset($attr['height'])) AND ($attr['height'] != '')) {
- $this->tdheight=($attr['height'] / $this->k);
- }
- else {
- $this->tdheight = $this->lasth;
- }
- if ((isset($attr['align'])) AND ($attr['align'] != '')) {
- switch ($attr['align']) {
- case 'center': {
- $this->tdalign = "C";
- break;
- }
- case 'right': {
- $this->tdalign = "R";
- break;
- }
- default:
- case 'left': {
- $this->tdalign = "L";
- break;
- }
- }
- }
- if ((isset($attr['bgcolor'])) AND ($attr['bgcolor'] != '')) {
- $coul = $this->convertColorHexToDec($attr['bgcolor']);
- $this->SetFillColor($coul['R'], $coul['G'], $coul['B']);
- $this->tdbgcolor=true;
- }
- $this->tdbegin=true;
- break;
- }
- case 'hr': {
- $this->Ln();
- if ((isset($attr['width'])) AND ($attr['width'] != '')) {
- $hrWidth = $attr['width'];
- }
- else {
- $hrWidth = $this->w - $this->lMargin - $this->rMargin;
- }
- $x = $this->GetX();
- $y = $this->GetY();
- $this->SetLineWidth(0.2);
- $this->Line($x, $y, $x + $hrWidth, $y);
- $this->SetLineWidth(0.2);
- $this->Ln();
- break;
- }
- case 'strong': {
- $this->setStyle('b', true);
- break;
- }
- case 'em': {
- $this->setStyle('i', true);
- break;
- }
- case 'b':
- case 'i':
- case 'u': {
- $this->setStyle($tag, true);
- break;
- }
- case 'a': {
- $this->HREF = $attr['href'];
- break;
- }
- case 'img': {
- if(isset($attr['src'])) {
- // replace relative path with real server path
- $attr['src'] = str_replace(K_PATH_URL_CACHE, K_PATH_CACHE, $attr['src']);
- if(!isset($attr['width'])) {
- $attr['width'] = 0;
- }
- if(!isset($attr['height'])) {
- $attr['height'] = 0;
- }
-
- $this->Image($attr['src'], $this->GetX(),$this->GetY(), $this->pixelsToMillimeters($attr['width']), $this->pixelsToMillimeters($attr['height']));
- //$this->SetX($this->img_rb_x);
- $this->SetY($this->img_rb_y);
-
- }
- break;
- }
- case 'ul': {
- $this->listordered = false;
- $this->listcount = 0;
- break;
- }
- case 'ol': {
- $this->listordered = true;
- $this->listcount = 0;
- break;
- }
- case 'li': {
- $this->Ln();
- if ($this->listordered) {
- $this->lispacer = " ".(++$this->listcount).". ";
- }
- else {
- //unordered list simbol
- $this->lispacer = " - ";
- }
- $this->Write($this->lasth, $this->lispacer, '', $fill);
- break;
- }
- case 'tr':
- case 'blockquote':
- case 'br': {
- $this->Ln();
- if(strlen($this->lispacer) > 0) {
- $this->x += $this->GetStringWidth($this->lispacer);
- }
- break;
- }
- case 'p': {
- $this->Ln();
- $this->Ln();
- break;
- }
- case 'sup': {
- $currentFontSize = $this->FontSize;
- $this->tempfontsize = $this->FontSizePt;
- $this->SetFontSize($this->FontSizePt * K_SMALL_RATIO);
- $this->SetXY($this->GetX(), $this->GetY() - (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
- break;
- }
- case 'sub': {
- $currentFontSize = $this->FontSize;
- $this->tempfontsize = $this->FontSizePt;
- $this->SetFontSize($this->FontSizePt * K_SMALL_RATIO);
- $this->SetXY($this->GetX(), $this->GetY() + (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
- break;
- }
- case 'small': {
- $currentFontSize = $this->FontSize;
- $this->tempfontsize = $this->FontSizePt;
- $this->SetFontSize($this->FontSizePt * K_SMALL_RATIO);
- $this->SetXY($this->GetX(), $this->GetY() + (($currentFontSize - $this->FontSize)/3));
- break;
- }
- case 'font': {
- if (isset($attr['color']) AND $attr['color']!='') {
- $coul = $this->convertColorHexToDec($attr['color']);
- $this->SetTextColor($coul['R'],$coul['G'],$coul['B']);
- $this->issetcolor=true;
- }
-
- // convertir les noms des polices de FckEditor
- $attr['face'] = $this->convertNameFont($attr['face']);
-
- if (isset($attr['face']) and in_array(strtolower($attr['face']), $this->fontlist)) {
- $this->SetFont(strtolower($attr['face']));
- $this->issetfont=true;
- }
- if (isset($attr['size'])) {
- $headsize = intval($attr['size']);
- } else {
- $headsize = 0;
- }
- $currentFontSize = $this->FontSize;
- $this->tempfontsize = $this->FontSizePt;
- //$this->SetFontSize($this->FontSizePt + $headsize);
- $this->SetFontSize($this->FontSizePt + $headsize - 3); // Todo: correction pour xx-small
- $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
- break;
- }
- case 'span': {
- if (isset($attr['style']) && $attr['style']!='') {
- if (preg_match("/color/i",$attr['style'])){
- if (preg_match("/rgb/i",$attr['style'])){
- //print 'style rgb '.$attr['style'].'
';
- $coul = substr($attr['style'],11,-2);
- list($R, $G, $B) = explode(', ', $coul);
- }
- else if (preg_match("/#/",$attr['style'])){
- //print 'style hexa '.$attr['style'].'
';
- $R = hexdec(substr($attr['style'],8,2));
- $G = hexdec(substr($attr['style'],10,2));
- $B = hexdec(substr($attr['style'],12,2));
- }
- //print 'color '.$R.' '.$G.' '.$B;
- $this->SetTextColor($R,$G,$B);
- $this->issetcolor=true;
- }
- if (preg_match("/font-family/i",$attr['style'])){
- $fontName = substr($attr['style'],13,-1);
- $fontName = $this->convertNameFont($fontName);
- if (isset($fontName) && in_array(strtolower($fontName), $this->fontlist)) {
- $this->SetFont(strtolower($fontName));
- $this->issetfont=true;
- //print 'fontfamily: '.$this->FontFamily.'
';
- }
- }
- if (preg_match("/font-size/i",$attr['style'])){
- $headsize = substr($attr['style'],11);
- $headsize = preg_replace('/[;-]/','',$headsize);
- //print 'headsize1: '.$headsize.'
';
- //print 'recupheadsize: '.$this->$headsize.'
';
- $headsize = intval($this->$headsize);
- //print 'headsize2: '.$headsize.'
';
- }
- } else {
- $headsize = 1;
- }
- $currentFontSize = $this->FontSize;
- $this->tempfontsize = $this->FontSizePt;
- //$this->SetFontSize($this->FontSizePt + $headsize);
- //print 'fontsizept: '.$this->FontSizePt.'
';
- $this->SetFontSize($this->FontSizePt + $headsize - 3); // Todo: correction pour xx-small
- $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
- //print 'fontsizeptafter: '.$this->FontSizePt.'
';
- //print 'fontsize:'.$this->FontSize.'
';
- //$this->closedHTMLTagHandler('span');
- break;
- }
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6': {
- $headsize = (4 - substr($tag, 1)) * 2;
- $currentFontSize = $this->FontSize;
- $this->tempfontsize = $this->FontSizePt;
- $this->SetFontSize($this->FontSizePt + $headsize);
- $this->setStyle('b', true);
- $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
- break;
- }
- }
- }
-
- /**
- * Process closing tags.
- * @param string $tag tag name (in uppercase)
- * @access private
- */
- function closedHTMLTagHandler($tag) {
- //Closing tag
- switch($tag) {
- case 'td':
- case 'th': {
- $this->tdbegin = false;
- $this->tdwidth = 0;
- $this->tdheight = 0;
- $this->tdalign = "L";
- $this->tdbgcolor = false;
- $this->SetFillColor($this->prevFillColor[0], $this->prevFillColor[1], $this->prevFillColor[2]);
- break;
- }
- case 'tr': {
- $this->Ln();
- break;
- }
- case 'table': {
- $this->tableborder=0;
- break;
- }
- case 'strong': {
- $this->setStyle('b', false);
- break;
- }
- case 'em': {
- $this->setStyle('i', false);
- break;
- }
- case 'b':
- case 'i':
- case 'u': {
- $this->setStyle($tag, false);
- break;
- }
- case 'a': {
- $this->HREF = '';
- break;
- }
- case 'sup': {
- $currentFontSize = $this->FontSize;
- $this->SetFontSize($this->tempfontsize);
- $this->tempfontsize = $this->FontSizePt;
- $this->SetXY($this->GetX(), $this->GetY() - (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
- break;
- }
- case 'sub': {
- $currentFontSize = $this->FontSize;
- $this->SetFontSize($this->tempfontsize);
- $this->tempfontsize = $this->FontSizePt;
- $this->SetXY($this->GetX(), $this->GetY() + (($currentFontSize - $this->FontSize)*(K_SMALL_RATIO)));
- break;
- }
- case 'small': {
- $currentFontSize = $this->FontSize;
- $this->SetFontSize($this->tempfontsize);
- $this->tempfontsize = $this->FontSizePt;
- $this->SetXY($this->GetX(), $this->GetY() - (($this->FontSize - $currentFontSize)/3));
- break;
- }
- case 'span':
- case 'font': {
- if ($this->issetcolor == true) {
- $this->SetTextColor($this->prevTextColor[0], $this->prevTextColor[1], $this->prevTextColor[2]);
- }
- if ($this->issetfont) {
- $this->FontFamily = $this->prevFontFamily;
- $this->FontStyle = $this->prevFontStyle;
- $this->SetFont($this->FontFamily);
- $this->issetfont = false;
- }
- $currentFontSize = $this->FontSize;
- $this->SetFontSize($this->tempfontsize);
- $this->tempfontsize = $this->FontSizePt;
- //$this->TextColor = $this->prevTextColor;
- $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
- break;
- }
- case 'ul': {
- $this->Ln();
- break;
- }
- case 'ol': {
- $this->Ln();
- break;
- }
- case 'li': {
- $this->lispacer = "";
- break;
- }
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6': {
- $currentFontSize = $this->FontSize;
- $this->SetFontSize($this->tempfontsize);
- $this->tempfontsize = $this->FontSizePt;
- $this->setStyle('b', false);
- $this->Ln();
- $this->lasth = $this->FontSize * K_CELL_HEIGHT_RATIO;
- break;
- }
- default : {
- break;
- }
- }
- }
-
- /**
- * Sets font style.
- * @param string $tag tag name (in lowercase)
- * @param boolean $enable
- * @access private
- */
- 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);
- }
-
- /**
- * Output anchor link.
- * @param string $url link URL
- * @param string $name link name
- * @param int $fill Indicates if the cell background must be painted (1) or transparent (0). Default value: 0.
- * @access public
- */
- function addHtmlLink($url, $name, $fill=0) {
- //Put a hyperlink
- $this->SetTextColor(0, 0, 255);
- $this->setStyle('u', true);
- $this->Write($this->lasth, $name, $url, $fill);
- $this->setStyle('u', false);
- $this->SetTextColor(0);
- }
-
- /**
- * Returns an associative array (keys: R,G,B) from
- * a hex html code (e.g. #3FE5AA).
- * @param string $color hexadecimal html color [#rrggbb]
- * @return array
- * @access private
- */
- function convertColorHexToDec($color = "#000000"){
- $tbl_color = array();
- $tbl_color['R'] = hexdec(substr($color, 1, 2));
- $tbl_color['G'] = hexdec(substr($color, 3, 2));
- $tbl_color['B'] = hexdec(substr($color, 5, 2));
- return $tbl_color;
- }
-
- /**
- * Converts pixels to millimeters in 72 dpi.
- * @param int $px pixels
- * @return float millimeters
- * @access private
- */
- function pixelsToMillimeters($px){
- return $px * 25.4 / 72;
- }
-
- /**
- * Reverse function for htmlentities.
- * Convert entities in UTF-8.
- *
- * @param $text_to_convert Text to convert.
- * @return string converted
- */
- function unhtmlentities($text_to_convert) {
- require_once(dirname(__FILE__).'/html_entity_decode_php4.php');
- return html_entity_decode_php4($text_to_convert);
- }
-
- /**
- * Set the image scale.
- * @param float $scale image scale.
- * @author Nicola Asuni
- * @since 1.5.2
- */
- function setImageScale($scale) {
- $this->imgscale=$scale;
- }
-
- /**
- * Returns the image scale.
- * @return float image scale.
- * @author Nicola Asuni
- * @since 1.5.2
- */
- function getImageScale() {
- return $this->imgscale;
- }
-
- /**
- * Returns the page width in units.
- * @return int page width.
- * @author Nicola Asuni
- * @since 1.5.2
- */
- function getPageWidth() {
- return $this->w;
- }
-
- /**
- * Returns the page height in units.
- * @return int page height.
- * @author Nicola Asuni
- * @since 1.5.2
- */
- function getPageHeight() {
- return $this->fh;
- }
-
- /**
- * Returns the page break margin.
- * @return int page break margin.
- * @author Nicola Asuni
- * @since 1.5.2
- */
- function getBreakMargin() {
- return $this->bMargin;
- }
-
- /**
- * Returns the scale factor (number of points in user unit).
- * @return int scale factor.
- * @author Nicola Asuni
- * @since 1.5.2
- */
- function getScaleFactor() {
- return $this->k;
- }
-
- /**
- * Converti les noms des polices FckEditor.
- * @string string chaine � convertir
- * @return string chaine convertie.
- * @author Regis Houssin
- */
- function convertNameFont($namefont)
- {
- if ($namefont == "Times New Roman")
- {
- $name = "times";
- }
- else if ($namefont == "Arial")
- {
- $name = "helvetica";
- }
- else if ($namefont == "Verdana")
- {
- $name = "helvetica";
- }
- else if ($namefont == "Comic Sans MS")
- {
- $name = "helvetica";
- }
- else if ($namefont == "Courier New")
- {
- $name = "courier";
- }
- else if ($namefont == "Tahoma")
- {
- $name = "helvetica";
- }
- return $name;
- }
-
- /**
- * Param�trage des pr�f�rences d'affichage.
- * @string preference liste des pr�f�rences d'affichage (voir la fonction _putcatalog)
- * @ex: $pdf->DisplayPreferences('HideMenubar,HideToolbar,HideWindowUI')
- * @author Michel Poulain
- */
- function DisplayPreferences($preferences)
- {
- $this->DisplayPreferences.=$preferences;
- }
-
- /* End DOLCHANGE Added by Regis */
-
-
-
-//End of class
-}
-
-//Handle special IE contype request
-if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
-{
- header('Content-Type: application/pdf');
- exit;
-}
-
-?>
diff --git a/htdocs/includes/fpdf/fpdf/histo.htm b/htdocs/includes/fpdf/fpdf/histo.htm
deleted file mode 100644
index 7097fd89034..00000000000
--- a/htdocs/includes/fpdf/fpdf/histo.htm
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
-History
-
-
-
-
diff --git a/htdocs/includes/fpdf/fpdf/html_entity_decode_php4.php b/htdocs/includes/fpdf/fpdf/html_entity_decode_php4.php
deleted file mode 100644
index ce4c004155a..00000000000
--- a/htdocs/includes/fpdf/fpdf/html_entity_decode_php4.php
+++ /dev/null
@@ -1,309 +0,0 @@
-> 0x06) + 0xC0).chr(($num & 0x3F) + 128);
- } elseif ($num <= 0xFFFF) {
- return chr(($num >> 0x0C) + 0xE0).chr((($num >> 0x06) & 0x3F) + 0x80).chr(($num & 0x3F) + 0x80);
- } elseif ($num <= 0x1FFFFF) {
- return chr(($num >> 0x12) + 0xF0).chr((($num >> 0x0C) & 0x3F) + 0x80).chr((($num >> 0x06) & 0x3F) + 0x80).chr(($num & 0x3F) + 0x80);
- }
- return ' '; // default value
-}
-
-/**
- * Reverse function for htmlentities.
- * Convert entities in UTF-8.
- * @param $text_to_convert Text to convert.
- * @return string converted
- */
-function html_entity_decode_php4($text_to_convert) {
- $htmlentities_table = array (
- "Á" => "".chr(195).chr(129)."",
- "á" => "".chr(195).chr(161)."",
- "Â" => "".chr(195).chr(130)."",
- "â" => "".chr(195).chr(162)."",
- "´" => "".chr(194).chr(180)."",
- "Æ" => "".chr(195).chr(134)."",
- "æ" => "".chr(195).chr(166)."",
- "À" => "".chr(195).chr(128)."",
- "à" => "".chr(195).chr(160)."",
- "ℵ" => "".chr(226).chr(132).chr(181)."",
- "Α" => "".chr(206).chr(145)."",
- "α" => "".chr(206).chr(177)."",
- "&" => "".chr(38)."",
- "∧" => "".chr(226).chr(136).chr(167)."",
- "∠" => "".chr(226).chr(136).chr(160)."",
- "Å" => "".chr(195).chr(133)."",
- "å" => "".chr(195).chr(165)."",
- "≈" => "".chr(226).chr(137).chr(136)."",
- "Ã" => "".chr(195).chr(131)."",
- "ã" => "".chr(195).chr(163)."",
- "Ä" => "".chr(195).chr(132)."",
- "ä" => "".chr(195).chr(164)."",
- "„" => "".chr(226).chr(128).chr(158)."",
- "Β" => "".chr(206).chr(146)."",
- "β" => "".chr(206).chr(178)."",
- "¦" => "".chr(194).chr(166)."",
- "•" => "".chr(226).chr(128).chr(162)."",
- "∩" => "".chr(226).chr(136).chr(169)."",
- "Ç" => "".chr(195).chr(135)."",
- "ç" => "".chr(195).chr(167)."",
- "¸" => "".chr(194).chr(184)."",
- "¢" => "".chr(194).chr(162)."",
- "Χ" => "".chr(206).chr(167)."",
- "χ" => "".chr(207).chr(135)."",
- "ˆ" => "".chr(203).chr(134)."",
- "♣" => "".chr(226).chr(153).chr(163)."",
- "≅" => "".chr(226).chr(137).chr(133)."",
- "©" => "".chr(194).chr(169)."",
- "↵" => "".chr(226).chr(134).chr(181)."",
- "∪" => "".chr(226).chr(136).chr(170)."",
- "¤" => "".chr(194).chr(164)."",
- "†" => "".chr(226).chr(128).chr(160)."",
- "‡" => "".chr(226).chr(128).chr(161)."",
- "↓" => "".chr(226).chr(134).chr(147)."",
- "⇓" => "".chr(226).chr(135).chr(147)."",
- "°" => "".chr(194).chr(176)."",
- "Δ" => "".chr(206).chr(148)."",
- "δ" => "".chr(206).chr(180)."",
- "♦" => "".chr(226).chr(153).chr(166)."",
- "÷" => "".chr(195).chr(183)."",
- "É" => "".chr(195).chr(137)."",
- "é" => "".chr(195).chr(169)."",
- "Ê" => "".chr(195).chr(138)."",
- "ê" => "".chr(195).chr(170)."",
- "È" => "".chr(195).chr(136)."",
- "è" => "".chr(195).chr(168)."",
- "∅" => "".chr(226).chr(136).chr(133)."",
- " " => "".chr(226).chr(128).chr(131)."",
- " " => "".chr(226).chr(128).chr(130)."",
- "Ε" => "".chr(206).chr(149)."",
- "ε" => "".chr(206).chr(181)."",
- "≡" => "".chr(226).chr(137).chr(161)."",
- "Η" => "".chr(206).chr(151)."",
- "η" => "".chr(206).chr(183)."",
- "Ð" => "".chr(195).chr(144)."",
- "ð" => "".chr(195).chr(176)."",
- "Ë" => "".chr(195).chr(139)."",
- "ë" => "".chr(195).chr(171)."",
- "€" => "".chr(226).chr(130).chr(172)."",
- "∃" => "".chr(226).chr(136).chr(131)."",
- "ƒ" => "".chr(198).chr(146)."",
- "∀" => "".chr(226).chr(136).chr(128)."",
- "½" => "".chr(194).chr(189)."",
- "¼" => "".chr(194).chr(188)."",
- "¾" => "".chr(194).chr(190)."",
- "⁄" => "".chr(226).chr(129).chr(132)."",
- "Γ" => "".chr(206).chr(147)."",
- "γ" => "".chr(206).chr(179)."",
- "≥" => "".chr(226).chr(137).chr(165)."",
- "↔" => "".chr(226).chr(134).chr(148)."",
- "⇔" => "".chr(226).chr(135).chr(148)."",
- "♥" => "".chr(226).chr(153).chr(165)."",
- "…" => "".chr(226).chr(128).chr(166)."",
- "Í" => "".chr(195).chr(141)."",
- "í" => "".chr(195).chr(173)."",
- "Î" => "".chr(195).chr(142)."",
- "î" => "".chr(195).chr(174)."",
- "¡" => "".chr(194).chr(161)."",
- "Ì" => "".chr(195).chr(140)."",
- "ì" => "".chr(195).chr(172)."",
- "ℑ" => "".chr(226).chr(132).chr(145)."",
- "∞" => "".chr(226).chr(136).chr(158)."",
- "∫" => "".chr(226).chr(136).chr(171)."",
- "Ι" => "".chr(206).chr(153)."",
- "ι" => "".chr(206).chr(185)."",
- "¿" => "".chr(194).chr(191)."",
- "∈" => "".chr(226).chr(136).chr(136)."",
- "Ï" => "".chr(195).chr(143)."",
- "ï" => "".chr(195).chr(175)."",
- "Κ" => "".chr(206).chr(154)."",
- "κ" => "".chr(206).chr(186)."",
- "Λ" => "".chr(206).chr(155)."",
- "λ" => "".chr(206).chr(187)."",
- "〈" => "".chr(226).chr(140).chr(169)."",
- "«" => "".chr(194).chr(171)."",
- "←" => "".chr(226).chr(134).chr(144)."",
- "⇐" => "".chr(226).chr(135).chr(144)."",
- "⌈" => "".chr(226).chr(140).chr(136)."",
- "“" => "".chr(226).chr(128).chr(156)."",
- "≤" => "".chr(226).chr(137).chr(164)."",
- "⌊" => "".chr(226).chr(140).chr(138)."",
- "∗" => "".chr(226).chr(136).chr(151)."",
- "◊" => "".chr(226).chr(151).chr(138)."",
- "" => "".chr(226).chr(128).chr(142)."",
- "‹" => "".chr(226).chr(128).chr(185)."",
- "‘" => "".chr(226).chr(128).chr(152)."",
- "¯" => "".chr(194).chr(175)."",
- "—" => "".chr(226).chr(128).chr(148)."",
- "µ" => "".chr(194).chr(181)."",
- "·" => "".chr(194).chr(183)."",
- "−" => "".chr(226).chr(136).chr(146)."",
- "Μ" => "".chr(206).chr(156)."",
- "μ" => "".chr(206).chr(188)."",
- "∇" => "".chr(226).chr(136).chr(135)."",
- " " => "".chr(194).chr(160)."",
- "–" => "".chr(226).chr(128).chr(147)."",
- "≠" => "".chr(226).chr(137).chr(160)."",
- "∋" => "".chr(226).chr(136).chr(139)."",
- "¬" => "".chr(194).chr(172)."",
- "∉" => "".chr(226).chr(136).chr(137)."",
- "⊄" => "".chr(226).chr(138).chr(132)."",
- "Ñ" => "".chr(195).chr(145)."",
- "ñ" => "".chr(195).chr(177)."",
- "Ν" => "".chr(206).chr(157)."",
- "ν" => "".chr(206).chr(189)."",
- "Ó" => "".chr(195).chr(147)."",
- "ó" => "".chr(195).chr(179)."",
- "Ô" => "".chr(195).chr(148)."",
- "ô" => "".chr(195).chr(180)."",
- "Œ" => "".chr(197).chr(146)."",
- "œ" => "".chr(197).chr(147)."",
- "Ò" => "".chr(195).chr(146)."",
- "ò" => "".chr(195).chr(178)."",
- "‾" => "".chr(226).chr(128).chr(190)."",
- "Ω" => "".chr(206).chr(169)."",
- "ω" => "".chr(207).chr(137)."",
- "Ο" => "".chr(206).chr(159)."",
- "ο" => "".chr(206).chr(191)."",
- "⊕" => "".chr(226).chr(138).chr(149)."",
- "∨" => "".chr(226).chr(136).chr(168)."",
- "ª" => "".chr(194).chr(170)."",
- "º" => "".chr(194).chr(186)."",
- "Ø" => "".chr(195).chr(152)."",
- "ø" => "".chr(195).chr(184)."",
- "Õ" => "".chr(195).chr(149)."",
- "õ" => "".chr(195).chr(181)."",
- "⊗" => "".chr(226).chr(138).chr(151)."",
- "Ö" => "".chr(195).chr(150)."",
- "ö" => "".chr(195).chr(182)."",
- "¶" => "".chr(194).chr(182)."",
- "∂" => "".chr(226).chr(136).chr(130)."",
- "‰" => "".chr(226).chr(128).chr(176)."",
- "⊥" => "".chr(226).chr(138).chr(165)."",
- "Φ" => "".chr(206).chr(166)."",
- "φ" => "".chr(207).chr(134)."",
- "Π" => "".chr(206).chr(160)."",
- "π" => "".chr(207).chr(128)."",
- "ϖ" => "".chr(207).chr(150)."",
- "±" => "".chr(194).chr(177)."",
- "£" => "".chr(194).chr(163)."",
- "′" => "".chr(226).chr(128).chr(178)."",
- "″" => "".chr(226).chr(128).chr(179)."",
- "∏" => "".chr(226).chr(136).chr(143)."",
- "∝" => "".chr(226).chr(136).chr(157)."",
- "Ψ" => "".chr(206).chr(168)."",
- "ψ" => "".chr(207).chr(136)."",
- "√" => "".chr(226).chr(136).chr(154)."",
- "〉" => "".chr(226).chr(140).chr(170)."",
- "»" => "".chr(194).chr(187)."",
- "→" => "".chr(226).chr(134).chr(146)."",
- "⇒" => "".chr(226).chr(135).chr(146)."",
- "⌉" => "".chr(226).chr(140).chr(137)."",
- "”" => "".chr(226).chr(128).chr(157)."",
- "ℜ" => "".chr(226).chr(132).chr(156)."",
- "®" => "".chr(194).chr(174)."",
- "⌋" => "".chr(226).chr(140).chr(139)."",
- "Ρ" => "".chr(206).chr(161)."",
- "ρ" => "".chr(207).chr(129)."",
- "" => "".chr(226).chr(128).chr(143)."",
- "›" => "".chr(226).chr(128).chr(186)."",
- "’" => "".chr(226).chr(128).chr(153)."",
- "‚" => "".chr(226).chr(128).chr(154)."",
- "Š" => "".chr(197).chr(160)."",
- "š" => "".chr(197).chr(161)."",
- "⋅" => "".chr(226).chr(139).chr(133)."",
- "§" => "".chr(194).chr(167)."",
- "" => "".chr(194).chr(173)."",
- "Σ" => "".chr(206).chr(163)."",
- "σ" => "".chr(207).chr(131)."",
- "ς" => "".chr(207).chr(130)."",
- "∼" => "".chr(226).chr(136).chr(188)."",
- "♠" => "".chr(226).chr(153).chr(160)."",
- "⊂" => "".chr(226).chr(138).chr(130)."",
- "⊆" => "".chr(226).chr(138).chr(134)."",
- "∑" => "".chr(226).chr(136).chr(145)."",
- "¹" => "".chr(194).chr(185)."",
- "²" => "".chr(194).chr(178)."",
- "³" => "".chr(194).chr(179)."",
- "⊃" => "".chr(226).chr(138).chr(131)."",
- "⊇" => "".chr(226).chr(138).chr(135)."",
- "ß" => "".chr(195).chr(159)."",
- "Τ" => "".chr(206).chr(164)."",
- "τ" => "".chr(207).chr(132)."",
- "∴" => "".chr(226).chr(136).chr(180)."",
- "Θ" => "".chr(206).chr(152)."",
- "θ" => "".chr(206).chr(184)."",
- "ϑ" => "".chr(207).chr(145)."",
- " " => "".chr(226).chr(128).chr(137)."",
- "Þ" => "".chr(195).chr(158)."",
- "þ" => "".chr(195).chr(190)."",
- "˜" => "".chr(203).chr(156)."",
- "×" => "".chr(195).chr(151)."",
- "™" => "".chr(226).chr(132).chr(162)."",
- "Ú" => "".chr(195).chr(154)."",
- "ú" => "".chr(195).chr(186)."",
- "↑" => "".chr(226).chr(134).chr(145)."",
- "⇑" => "".chr(226).chr(135).chr(145)."",
- "Û" => "".chr(195).chr(155)."",
- "û" => "".chr(195).chr(187)."",
- "Ù" => "".chr(195).chr(153)."",
- "ù" => "".chr(195).chr(185)."",
- "¨" => "".chr(194).chr(168)."",
- "ϒ" => "".chr(207).chr(146)."",
- "Υ" => "".chr(206).chr(165)."",
- "υ" => "".chr(207).chr(133)."",
- "Ü" => "".chr(195).chr(156)."",
- "ü" => "".chr(195).chr(188)."",
- "℘" => "".chr(226).chr(132).chr(152)."",
- "Ξ" => "".chr(206).chr(158)."",
- "ξ" => "".chr(206).chr(190)."",
- "Ý" => "".chr(195).chr(157)."",
- "ý" => "".chr(195).chr(189)."",
- "¥" => "".chr(194).chr(165)."",
- "ÿ" => "".chr(195).chr(191)."",
- "Ÿ" => "".chr(197).chr(184)."",
- "Ζ" => "".chr(206).chr(150)."",
- "ζ" => "".chr(206).chr(182)."",
- "" => "".chr(226).chr(128).chr(141)."",
- "" => "".chr(226).chr(128).chr(140)."",
- ">" => ">",
- "<" => "<"
- );
- $return_text = strtr($text_to_convert, $htmlentities_table);
- $return_text = preg_replace('~([0-9a-f]+);~ei', 'code_to_utf8(hexdec("\\1"))', $return_text);
- $return_text = preg_replace('~([0-9]+);~e', 'code_to_utf8(\\1)', $return_text);
- return $return_text;
-}
-
-//============================================================+
-// END OF FILE
-//============================================================+
-?>
\ No newline at end of file
diff --git a/htdocs/includes/fpdf/fpdf/image_alpha.php b/htdocs/includes/fpdf/fpdf/image_alpha.php
deleted file mode 100755
index d97788e3a24..00000000000
--- a/htdocs/includes/fpdf/fpdf/image_alpha.php
+++ /dev/null
@@ -1,295 +0,0 @@
-images[$file]))
- {
- //First use of this image, get info
- if($type=='')
- {
- $pos=strrpos($file,'.');
- if(!$pos)
- $this->Error('Image file has no extension and no type was specified: '.$file);
- $type=substr($file,$pos+1);
- }
- $type=strtolower($type);
- if($type=='png'){
- $info=$this->_parsepng($file);
- if($info=='alpha')
- return $this->ImagePngWithAlpha($file,$x,$y,$w,$h,$link);
- }
- else
- {
- if($type=='jpeg')
- $type='jpg';
- $mtd='_parse'.$type;
- if(!method_exists($this,$mtd))
- $this->Error('Unsupported image type: '.$type);
- $info=$this->$mtd($file);
- }
- if($isMask){
- if(in_array($file,$this->tmpFiles))
- $info['cs']='DeviceGray'; //hack necessary as GD can't produce gray scale images
- if($info['cs']!='DeviceGray')
- $this->Error('Mask must be a gray scale image');
- if($this->PDFVersion<'1.4')
- $this->PDFVersion='1.4';
- }
- $info['i']=count($this->images)+1;
- if($maskImg>0)
- $info['masked'] = $maskImg;
- $this->images[$file]=$info;
- }
- else
- $info=$this->images[$file];
- //Automatic width and height calculation if needed
- if($w==0 && $h==0)
- {
- //Put image at 72 dpi
- $w=$info['w']/$this->k;
- $h=$info['h']/$this->k;
- }
- elseif($w==0)
- $w=$h*$info['w']/$info['h'];
- elseif($h==0)
- $h=$w*$info['h']/$info['w'];
- //Flowing mode
- if($y===null)
- {
- if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
- {
- //Automatic page break
- $x2=$this->x;
- $this->AddPage($this->CurOrientation,$this->CurPageFormat);
- $this->x=$x2;
- }
- $y=$this->y;
- $this->y+=$h;
- }
- if($x===null)
- $x=$this->x;
- if(!$isMask)
- $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
- if($link)
- $this->Link($x,$y,$w,$h,$link);
- return $info['i'];
-}
-
-// needs GD 2.x extension
-// pixel-wise operation, not very fast
-function ImagePngWithAlpha($file,$x,$y,$w=0,$h=0,$link='')
-{
- $tmp_alpha = tempnam('.', 'mska');
- $this->tmpFiles[] = $tmp_alpha;
- $tmp_plain = tempnam('.', 'mskp');
- $this->tmpFiles[] = $tmp_plain;
-
- list($wpx, $hpx) = getimagesize($file);
- $img = imagecreatefrompng($file);
- $alpha_img = imagecreate( $wpx, $hpx );
-
- // generate gray scale pallete
- for($c=0;$c<256;$c++)
- ImageColorAllocate($alpha_img, $c, $c, $c);
-
- // extract alpha channel
- $xpx=0;
- while ($xpx<$wpx){
- $ypx = 0;
- while ($ypx<$hpx){
- $color_index = imagecolorat($img, $xpx, $ypx);
- $col = imagecolorsforindex($img, $color_index);
- imagesetpixel($alpha_img, $xpx, $ypx, $this->_gamma( (127-$col['alpha'])*255/127) );
- ++$ypx;
- }
- ++$xpx;
- }
-
- imagepng($alpha_img, $tmp_alpha);
- imagedestroy($alpha_img);
-
- // extract image without alpha channel
- $plain_img = imagecreatetruecolor ( $wpx, $hpx );
- imagecopy($plain_img, $img, 0, 0, 0, 0, $wpx, $hpx );
- imagepng($plain_img, $tmp_plain);
- imagedestroy($plain_img);
-
- //first embed mask image (w, h, x, will be ignored)
- $maskImg = $this->Image($tmp_alpha, 0,0,0,0, 'PNG', '', true);
-
- //embed image, masked with previously embedded mask
- $this->Image($tmp_plain,$x,$y,$w,$h,'PNG',$link, false, $maskImg);
-}
-
-function Close()
-{
- parent::Close();
- // clean up tmp files
- foreach($this->tmpFiles as $tmp)
- @unlink($tmp);
-}
-
-/*******************************************************************************
-* *
-* Private methods *
-* *
-*******************************************************************************/
-function _putimages()
-{
- $filter=($this->compress) ? '/Filter /FlateDecode ' : '';
- reset($this->images);
- while(list($file,$info)=each($this->images))
- {
- $this->_newobj();
- $this->images[$file]['n']=$this->n;
- $this->_out('<_out('/Subtype /Image');
- $this->_out('/Width '.$info['w']);
- $this->_out('/Height '.$info['h']);
-
- if(isset($info['masked']))
- $this->_out('/SMask '.($this->n-1).' 0 R');
-
- if($info['cs']=='Indexed')
- $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
- else
- {
- $this->_out('/ColorSpace /'.$info['cs']);
- if($info['cs']=='DeviceCMYK')
- $this->_out('/Decode [1 0 1 0 1 0 1 0]');
- }
- $this->_out('/BitsPerComponent '.$info['bpc']);
- if(isset($info['f']))
- $this->_out('/Filter /'.$info['f']);
- if(isset($info['parms']))
- $this->_out($info['parms']);
- if(isset($info['trns']) && is_array($info['trns']))
- {
- $trns='';
- for($i=0;$i
-- Images can now trigger page breaks.
-- Possibility to have different page formats in a single document.
-- Document properties (author, creator, keywords, subject and title) can now be specified in UTF-8.
-- Fixed a bug: when a PNG was inserted through a URL, an error sometimes occurred.
-- An automatic page break in Header() doesn't cause an infinite loop any more.
-- Removed some warning messages appearing with recent PHP versions.
-- Added HTTP headers to reduce problems with IE.
-
-- The array $HTTP_SERVER_VARS is no longer used. It could cause trouble on PHP5-based configurations with the register_long_arrays option disabled.
-- Fixed a problem related to Type1 font embedding which caused trouble to some PDF processors.
-- The file name sent to the browser could not contain a space character.
-- The Cell() method could not print the number 0 (you had to pass the string '0').
-
-- Output() takes a string as second parameter to indicate destination.
-- Open() is now called automatically by AddPage().
-- Inserting remote JPEG images doesn't generate an error any longer.
-- Decimal separator is forced to dot in the constructor.
-- Added several encodings (Turkish, Thai, Hebrew, Ukrainian and Vietnamese).
-- The last line of a right-aligned MultiCell() was not correctly aligned if it was terminated by a carriage return.
-- No more error message about already sent headers when outputting the PDF to the standard output from the command line.
-- The underlining was going too far for text containing characters \, ( or ).
-- $HTTP_ENV_VARS has been replaced by $HTTP_SERVER_VARS.
-
-- Added Baltic encoding.
-- The class now works internally in points with the origin at the bottom in order to avoid two bugs occurring with Acrobat 5 :
* The line thickness was too large when printed under Windows 98 SE and ME.
* TrueType fonts didn't appear immediately inside the plug-in (a substitution font was used), one had to cause a window refresh to make them show up.
-- It is no longer necessary to set the decimal separator as dot to produce valid documents.
-- The clickable area in a cell was always on the left independently from the text alignment.
-- JPEG images in CMYK mode appeared in inverted colors.
-- Transparent PNG images in grayscale or true color mode were incorrectly handled.
-- Adding new fonts now works correctly even with the magic_quotes_runtime option set to on.
-
-- Added Write() method.
-- Added underlined style.
-- Internal and external link support (AddLink(), SetLink(), Link()).
-- Added right margin management and methods SetRightMargin(), SetTopMargin().
-- Modification of SetDisplayMode() to select page layout.
-- The border parameter of MultiCell() now lets choose borders to draw as Cell().
-- When a document contains no page, Close() now calls AddPage() instead of causing a fatal error.
-
-
-- Page compression (SetCompression()).
-- Choice of page format and possibility to change orientation inside document.
-- Added AcceptPageBreak() method.
-- Ability to print the total number of pages (AliasNbPages()).
-- Choice of cell borders to draw.
-- New mode for Cell(): the current position can now move under the cell.
-- Ability to include an image by specifying height only (width is calculated automatically).
-- Fixed a bug: when a justified line triggered a page break, the footer inherited the corresponding word spacing.
-
-- Removed Expires HTTP header (gives trouble in some situations).
-- Added Content-disposition HTTP header (seems to help in some situations).
-
-- Color support (SetDrawColor(), SetFillColor(), SetTextColor()). Possibility to draw filled rectangles and paint cell background.
-- A cell whose width is declared null extends up to the right margin of the page.
-- Line width is now retained from page to page and defaults to 0.2 mm.
-- Added SetXY() method.
-- Fixed a passing by reference done in a deprecated manner for PHP4.
-
-- Centering and right-aligning text in cells.
-- Display mode control (SetDisplayMode()).
-- Added methods to set document properties (SetAuthor(), SetCreator(), SetKeywords(), SetSubject(), SetTitle()).
-- Possibility to force PDF download by browser.
-- Added SetX() and GetX() methods.
-- During automatic page break, current abscissa is now retained.
-
-- Image insertion now works correctly even with magic_quotes_runtime option set to on.
-
-
-
-