diff --git a/e107_plugins/calendar_menu/ec_pf_page.php b/e107_plugins/calendar_menu/ec_pf_page.php
index 12b107c13..2c1f825da 100644
--- a/e107_plugins/calendar_menu/ec_pf_page.php
+++ b/e107_plugins/calendar_menu/ec_pf_page.php
@@ -322,13 +322,13 @@ if ($cal_totev > 0)
$ec_last_day = $thisevent_start_date['mday'];
}
-// Add footer
- $cal_text .= $e107->tp->parseTemplate($EVENT_CAL_PDF_FOOTER[$ec_pdf_template], FALSE, $calSc);
- if ($ec_output_type == 'print') $cal_text .= "\n";
+ // Add footer
+ $cal_text .= $e107->tp->parseTemplate($EVENT_CAL_PDF_FOOTER[$ec_pdf_template], FALSE, $calSc);
+ if ($ec_output_type == 'print') $cal_text .= "\n";
}
else
{
- $cal_text.= EC_LAN_148;
+ $cal_text.= EC_LAN_148;
}
switch($ec_output_type)
@@ -344,11 +344,7 @@ switch($ec_output_type)
case 'pdf':
//TODO find a way to pass initialisation options etc to PDF driver
- include_lan(e_PLUGIN.'pdf/languages/'.e_LANGUAGE.'.php');
-// define('FPDF_FONTPATH', 'font/');
- //require the ufpdf class
-// require_once (e_PLUGIN.'pdf/ufpdf.php');
- //require the e107pdf class
+ //include_lan(e_PLUGIN.'pdf/languages/'.e_LANGUAGE.'_admin_pdf.php'); - shouldn't be needed
require_once (e_PLUGIN.'pdf/e107pdf.php');
$pdf = new e107PDF();
// $text = array($text, $creator, $author, $title, $subject, $keywords, $url);
diff --git a/e107_plugins/pdf/2dbarcodes.php b/e107_plugins/pdf/2dbarcodes.php
index dae9cca3e..6490dfa7e 100644
--- a/e107_plugins/pdf/2dbarcodes.php
+++ b/e107_plugins/pdf/2dbarcodes.php
@@ -1,103 +1,313 @@
.
-//
-// See LICENSE.TXT file for more information.
-// ----------------------------------------------------------------------------
+// Last Update : 2012-04-30
+// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
+// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
+// -------------------------------------------------------------------
+// Copyright (C) 2009-2012 Nicola Asuni - Tecnick.com LTD
//
-// Description : PHP class to creates array representations for
+// This file is part of TCPDF software library.
+//
+// TCPDF is free software: you can redistribute it and/or modify it
+// under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// TCPDF is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with TCPDF. If not, see
- * @name TCPDFBarcode
- * @package com.tecnick.tcpdf
- * @version 1.0.000
- * @author Nicola Asuni
- * @link http://www.tcpdf.org
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
+/**
+ * @class TCPDF2DBarcode
+ * PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).
+ * @package com.tecnick.tcpdf
+ * @version 1.0.014
+ * @author Nicola Asuni
+ */
class TCPDF2DBarcode {
-
+
/**
- * @var array representation of barcode.
- * @access protected
+ * Array representation of barcode.
+ * @protected
*/
- protected $barcode_array;
-
+ protected $barcode_array = false;
+
/**
- * This is the class constructor.
+ * This is the class constructor.
* Return an array representations for 2D barcodes:
+ * Non-Unicode or missing PCRE unicode support: "/[^\S\xa0]/" + * Unicode and PCRE unicode support: "/[^\S\P{Z}\xa0]/u" + * Unicode and PCRE unicode support in Chinese mode: "/[^\S\P{Z}\P{Lo}\xa0]/u" + * if PCRE unicode support is turned ON ("\P" is the negate class of "\p"): + * "\p{Z}" or "\p{Separator}": any kind of Unicode whitespace or invisible separator. + * "\p{Lo}" or "\p{Other_Letter}": a Unicode letter or ideograph that does not have lowercase and uppercase variants. + * "\p{Lo}" is needed for Chinese characters because are packed next to each other without spaces in between. + *+ * @param $re (string) regular expression (leave empty for default). + * @public + * @since 4.6.016 (2009-06-15) + */ + public function setSpacesRE($re='/[^\S\xa0]/') { + $this->re_spaces = $re; + $re_parts = explode('/', $re); + // get pattern parts + $this->re_space = array(); + if (isset($re_parts[1]) AND !empty($re_parts[1])) { + $this->re_space['p'] = $re_parts[1]; + } else { + $this->re_space['p'] = '[\s]'; + } + // set pattern modifiers + if (isset($re_parts[2]) AND !empty($re_parts[2])) { + $this->re_space['m'] = $re_parts[2]; + } else { + $this->re_space['m'] = ''; + } + } + + /** + * Enable or disable Right-To-Left language mode + * @param $enable (Boolean) if true enable Right-To-Left language mode. + * @param $resetx (Boolean) if true reset the X position on direction change. + * @public + * @since 2.0.000 (2008-01-03) + */ + public function setRTL($enable, $resetx=true) { + $enable = $enable ? true : false; + $resetx = ($resetx AND ($enable != $this->rtl)); + $this->rtl = $enable; + $this->tmprtl = false; + if ($resetx) { + $this->Ln(0); + } + } + + /** + * Return the RTL status + * @return boolean + * @public + * @since 4.0.012 (2008-07-24) + */ + public function getRTL() { + return $this->rtl; + } + + /** + * Force temporary RTL language direction + * @param $mode (mixed) can be false, 'L' for LTR or 'R' for RTL + * @public + * @since 2.1.000 (2008-01-09) + */ + public function setTempRTL($mode) { + $newmode = false; + switch (strtoupper($mode)) { + case 'LTR': + case 'L': { + if ($this->rtl) { + $newmode = 'L'; } + break; } - if ($this->empty_string($bottommargin)) { - if (isset($this->bMargin)) { - $bottommargin = $this->bMargin; - } else { - // default value = 2 cm - $bottommargin = 2 * 28.35 / $this->k; + case 'RTL': + case 'R': { + if (!$this->rtl) { + $newmode = 'R'; } + break; } - $this->SetAutoPageBreak($autopagebreak, $bottommargin); - // store page dimensions - $this->pagedim[$this->page] = array('w' => $this->wPt, 'h' => $this->hPt, 'wk' => $this->w, 'hk' => $this->h, 'tm' => $this->tMargin, 'bm' => $bottommargin, 'lm' => $this->lMargin, 'rm' => $this->rMargin, 'pb' => $autopagebreak, 'or' => $this->CurOrientation, 'olm' => $this->original_lMargin, 'orm' => $this->original_rMargin); - } - - /** - * Set regular expression to detect withespaces or word separators. - * @param string $re regular expression (leave empty for default). - * @access public - * @since 4.6.016 (2009-06-15) - */ - public function setSpacesRE($re='/[\s]/') { - // if PCRE unicode support is turned ON: - // \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator. - // \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants. - // \p{Lo} is needed because Chinese characters are packed next to each other without spaces in between. - $this->re_spaces = $re; - } - - /** - * Enable or disable Right-To-Left language mode - * @param Boolean $enable if true enable Right-To-Left language mode. - * @param Boolean $resetx if true reset the X position on direction change. - * @access public - * @since 2.0.000 (2008-01-03) - */ - public function setRTL($enable, $resetx=true) { - $enable = $enable ? true : false; - $resetx = ($resetx AND ($enable != $this->rtl)); - $this->rtl = $enable; - $this->tmprtl = false; - if ($resetx) { - $this->Ln(0); + case false: + default: { + $newmode = false; + break; } } - - /** - * Return the RTL status - * @return boolean - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getRTL() { - return $this->rtl; + $this->tmprtl = $newmode; + } + + /** + * Return the current temporary RTL status + * @return boolean + * @public + * @since 4.8.014 (2009-11-04) + */ + public function isRTLTextDir() { + return ($this->rtl OR ($this->tmprtl == 'R')); + } + + /** + * Set the last cell height. + * @param $h (float) cell height. + * @author Nicola Asuni + * @public + * @since 1.53.0.TC034 + */ + public function setLastH($h) { + $this->lasth = $h; + } + + /** + * Reset the last cell height. + * @public + * @since 5.9.000 (2010-10-03) + */ + public function resetLastH() { + $this->lasth = ($this->FontSize * $this->cell_height_ratio) + $this->cell_padding['T'] + $this->cell_padding['B']; + } + + /** + * Get the last cell height. + * @return last cell height + * @public + * @since 4.0.017 (2008-08-05) + */ + public function getLastH() { + return $this->lasth; + } + + /** + * Set the adjusting factor to convert pixels to user units. + * @param $scale (float) adjusting factor to convert pixels to user units. + * @author Nicola Asuni + * @public + * @since 1.5.2 + */ + public function setImageScale($scale) { + $this->imgscale = $scale; + } + + /** + * Returns the adjusting factor to convert pixels to user units. + * @return float adjusting factor to convert pixels to user units. + * @author Nicola Asuni + * @public + * @since 1.5.2 + */ + public function getImageScale() { + return $this->imgscale; + } + + /** + * Returns an array of page dimensions: + *