Skip to content

Commit

Permalink
MDL-32447 import latest tcpdf and point cache to tcpdf subdirectory o…
Browse files Browse the repository at this point in the history
…f moodle cache dir
  • Loading branch information
skodak committed Apr 15, 2012
1 parent 668a499 commit 585ae3d
Show file tree
Hide file tree
Showing 44 changed files with 1,225 additions and 701 deletions.
3 changes: 2 additions & 1 deletion lib/pdflib.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
define('K_PATH_FONTS', K_PATH_MAIN . 'fonts/');

/** cache directory for temporary files (full path) */
define('K_PATH_CACHE', $CFG->cachedir . '/');
define('K_PATH_CACHE', $CFG->cachedir . '/tcpdf/');

/** images directory */
define('K_PATH_IMAGES', $CFG->dirroot . '/');
Expand Down Expand Up @@ -99,6 +99,7 @@ class pdf extends TCPDF {
* See the parent class documentation for the parameters info.
*/
public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8') {
make_cache_directory('tcpdf');

parent::__construct($orientation, $unit, $format, $unicode, $encoding);

Expand Down
15 changes: 7 additions & 8 deletions lib/tcpdf/2dbarcodes.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
//============================================================+
// File name : 2dbarcodes.php
// Version : 1.0.012
// Version : 1.0.013
// Begin : 2009-04-07
// Last Update : 2011-09-15
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - [email protected]
// Last Update : 2012-01-12
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2009-2011 Nicola Asuni - Tecnick.com S.r.l.
// Copyright (C) 2009-2012 Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
Expand Down Expand Up @@ -37,14 +37,14 @@
* PHP class to creates array representations for 2D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.012
* @version 1.0.013
*/

/**
* @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.012
* @version 1.0.013
* @author Nicola Asuni
*/
class TCPDF2DBarcode {
Expand Down Expand Up @@ -142,8 +142,7 @@ public function getBarcodeSVGcode($w=3, $h=3, $color='black') {
* @public
*/
public function getBarcodeHTML($w=10, $h=10, $color='black') {
// replace table for special characters
$html = '<div style="font-size:0;position:relative;">'."\n";
$html = '<div style="font-size:0;position:relative;width:'.($w * $this->barcode_array['num_cols']).'px;height:'.($h * $this->barcode_array['num_rows']).'px;">'."\n";
// print barcode elements
$y = 0;
// for each row
Expand Down
95 changes: 95 additions & 0 deletions lib/tcpdf/CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,3 +1,98 @@
5.9.156 (2012-04-10)
- Bug item #3515885 "TOC and booklet: left and right page exchanged".
- SetAutoPageBreak(false) now works also in multicolumn mode.

5.9.155 (2012-04-02)
- Bug item #3512596 "font import problems" was fixed.
- Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation).
- All fonts were updated.
- Bug item #3513867 "booklet and setHeaderTemplateAutoreset: header shifted left" was fixed.
- Bug item #3513749 "TCPDF Superscript/Subscript" was fixed.

5.9.154 (2012-03-29)
- A debug echo was removed.

5.9.153 (2012-03-28)
- A bug on font conversion was fixed.
- All fonts were updated.
- Method isCharDefined() was added to find if a character is defined on the selected font.
- Method replaceMissingChars() was added to automatically replace missing chars on selected font.
- SetFont() method was fixed.

5.9.152 (2012-03-23)
- The following overprint methods were added: setOverprint(), getOverprint().
- Signature of setAlpha() method was changed and method getAlpha() was added.
- stroke-opacity support was added on SVG.
- The following date methods were added: setDocCreationTimestamp(), setDocModificationTimestamp(), getDocCreationTimestamp(), getDocModificationTimestamp(), getFormattedDate(), getTimestamp().
- Signature of _datestring() method was changed.
- Method getFontBBox() was added.
- Method setPageBoxTypes() was aded.

5.9.151 (2012-03-22)
- Bug item #3509889 "Transform() distorts PDF" was fixed.
- Precision of real number were extended.
- ComboBox and ListBox methods were fixed.
- Bulgarian language file was added.
- addTOC() method was improved to include bookmark color and font style.

5.9.150 (2012-03-16)
- A bug related to form fields in PDF/A mode was fixed.

5.9.149 (2012-02-21)
- Bug item #3489933 "SVG Parser treats tspan like text" was fixed.

5.9.148 (2012-02-17)
- Bug item #3488600 "Multiple radiobutton sets get first set value" was fixed.

5.9.147 (2012-02-14)
- A problem with SVG gradients has been fixed.

5.9.146 (2012-02-12)
- Bug item #3486880 "$filehash undefine error" was fixed.
- The default font is now the one specified at PDF_FONT_NAME_MAIN constant.

5.9.145 (2012-01-28)
- Japanese language file was added.
- TCPDF license and README.TXT files were updated.

5.9.144 (2012-01-12)
- HTML output on barcode classes was improved.

5.9.143 (2012-01-08)
- Bug item #3471057 "setCreator() has no effect" was fixed.

5.9.142 (2011-12-23)
- Source code documentation was updated.

5.9.141 (2011-12-14)
- Some minor bugs were fixed.

5.9.140 (2011-12-13)
- SVG now supports embedded images encoded as base64.

5.9.139 (2011-12-11)
- Spot color methods were fixed.

5.9.138 (2011-12-10)
- cropMark() method was improved (check source code documentation).
- Example n. 56 was updated.
- Bug item #3452390 "Check Box still not ticked when set to true" was fixed.

5.9.137 (2011-12-01)
- Bug item #3447005 "Background color and border of Form Elements is printed" was fixed.
- Color support for Form elements was improved.

5.9.136 (2011-11-27)
- Bug item #3443387 "SetMargins with keep option does not work for top margin" was fixed.

5.9.135 (2011-11-04)
- Bug item #3433406 "Double keywords in description" was fixed.

5.9.134 (2011-10-29)
- The default value for $defcol parameter on convertHTMLColorToDec() method was fixed.
- Deafult HTTP headers were changed to avoid browser caching.
- Some deprecated syntax were replaced.

5.9.133 (2011-10-26)
- Bug item #3428446 "copyPage method not working when diskcache enabled" was fixed.

Expand Down
4 changes: 1 addition & 3 deletions lib/tcpdf/LICENSE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
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. Additionally,
YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE
GENERATED PDF DOCUMENTS.
License, or (at your option) any later version.

**********************************************************************
**********************************************************************
Expand Down
30 changes: 18 additions & 12 deletions lib/tcpdf/README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------

Name: TCPDF
Version: 5.9.133
Release date: 2011-10-26
Version: 5.9.156
Release date: 2012-04-10
Author: Nicola Asuni

Copyright (c) 2002-2011:
Copyright (c) 2002-2012:
Nicola Asuni
Tecnick.com s.r.l.
Via Della Pace, 11
09044 Quartucciu (CA)
ITALY
Tecnick.com LTD
Manor Coach House, Church Hill
Aldershot, Hants, GU12 4RQ
UK
www.tecnick.com

URLs:
Expand Down Expand Up @@ -64,18 +64,16 @@ Installation (full instructions on http: www.tcpdf.org):
Source Code Documentation:
http://www.tcpdf.org

For Additional Documentation:
Additional Documentation:
http://www.tcpdf.org

License
Copyright (C) 2002-2011 Nicola Asuni - Tecnick.com S.r.l.
Copyright (C) 2002-2012 Nicola Asuni - Tecnick.com LTD

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. Additionally,
YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE
GENERATED PDF DOCUMENTS.
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
Expand All @@ -88,4 +86,12 @@ License

See LICENSE.TXT file for more information.

Third party fonts
This library includes third party font files released with different licenses.
These fonts are not required by TCPDF but have been included as you convenience.
The original TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files).
To get the original distribution archives please check the information on fonts subfolders:
- DejaVu fonts 2.33 (Bitstream) - Copyright, License and other info: fonts/dejavu-fonts-ttf-2.33
- GNU FreeFont (GNU-GPLv3) - Copyright, License and other info: fonts/freefont-20100919

============================================================
15 changes: 7 additions & 8 deletions lib/tcpdf/barcodes.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
//============================================================+
// File name : barcodes.php
// Version : 1.0.021
// Version : 1.0.023
// Begin : 2008-06-09
// Last Update : 2011-09-15
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - [email protected]
// Last Update : 2012-01-14
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2008-2011 Nicola Asuni - Tecnick.com S.r.l.
// Copyright (C) 2008-2012 Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
Expand Down Expand Up @@ -37,14 +37,14 @@
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF.
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 1.0.021
* @version 1.0.023
*/

/**
* @class TCPDFBarcode
* PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br>
* @package com.tecnick.tcpdf
* @version 1.0.021
* @version 1.0.023
* @author Nicola Asuni
*/
class TCPDFBarcode {
Expand Down Expand Up @@ -145,8 +145,7 @@ public function getBarcodeSVGcode($w=2, $h=30, $color='black') {
* @public
*/
public function getBarcodeHTML($w=2, $h=30, $color='black') {
// replace table for special characters
$html = '<div style="font-size:0;position:relative;">'."\n";
$html = '<div style="font-size:0;position:relative;width:'.($this->barcode_array['maxw'] * $w).'px;height:'.($h).'px;">'."\n";
// print bars
$x = 0;
foreach ($this->barcode_array['bcode'] as $k => $v) {
Expand Down
28 changes: 19 additions & 9 deletions lib/tcpdf/config/tcpdf_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@
// Last Update : 2011-04-15
//
// Description : Configuration file for TCPDF.
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2004-2012 Nicola Asuni - Tecnick.com LTD
//
// Author: Nicola Asuni
// This file is part of TCPDF software library.
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// [email protected]
// 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 <http://www.gnu.org/licenses/>.
//
// See LICENSE.TXT file for more information.
//============================================================+

/**
Expand Down
16 changes: 8 additions & 8 deletions lib/tcpdf/datamatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// Version : 1.0.001
// Begin : 2010-06-07
// Last Update : 2011-09-14
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - [email protected]
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - [email protected]
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2010-2011 Nicola Asuni - Tecnick.com S.r.l.
// Copyright (C) 2010-2012 Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
Expand Down Expand Up @@ -941,7 +941,7 @@ protected function getHighLevelEncoding($data) {
/**
* Places "chr+bit" with appropriate wrapping within array[].
* (Annex F - ECC 200 symbol character placement)
* @param $marr array Array of symbols.
* @param $marr (array) Array of symbols.
* @param $nrow (int) Number of rows.
* @param $ncol (int) Number of columns.
* @param $row (int) Row number.
Expand All @@ -967,7 +967,7 @@ protected function placeModule($marr, $nrow, $ncol, $row, $col, $chr, $bit) {
/**
* Places the 8 bits of a utah-shaped symbol character.
* (Annex F - ECC 200 symbol character placement)
* @param $marr array Array of symbols.
* @param $marr (array) Array of symbols.
* @param $nrow (int) Number of rows.
* @param $ncol (int) Number of columns.
* @param $row (int) Row number.
Expand All @@ -991,7 +991,7 @@ protected function placeUtah($marr, $nrow, $ncol, $row, $col, $chr) {
/**
* Places the 8 bits of the first special corner case.
* (Annex F - ECC 200 symbol character placement)
* @param $marr array Array of symbols.
* @param $marr (array) Array of symbols.
* @param $nrow (int) Number of rows.
* @param $ncol (int) Number of columns.
* @param $chr (int) Char byte.
Expand All @@ -1013,7 +1013,7 @@ protected function placeCornerA($marr, $nrow, $ncol, $chr) {
/**
* Places the 8 bits of the second special corner case.
* (Annex F - ECC 200 symbol character placement)
* @param $marr array Array of symbols.
* @param $marr (array) Array of symbols.
* @param $nrow (int) Number of rows.
* @param $ncol (int) Number of columns.
* @param $chr (int) Char byte.
Expand All @@ -1035,7 +1035,7 @@ protected function placeCornerB($marr, $nrow, $ncol, $chr) {
/**
* Places the 8 bits of the third special corner case.
* (Annex F - ECC 200 symbol character placement)
* @param $marr array Array of symbols.
* @param $marr (array) Array of symbols.
* @param $nrow (int) Number of rows.
* @param $ncol (int) Number of columns.
* @param $chr (int) Char byte.
Expand All @@ -1057,7 +1057,7 @@ protected function placeCornerC($marr, $nrow, $ncol, $chr) {
/**
* Places the 8 bits of the fourth special corner case.
* (Annex F - ECC 200 symbol character placement)
* @param $marr array Array of symbols.
* @param $marr (array) Array of symbols.
* @param $nrow (int) Number of rows.
* @param $ncol (int) Number of columns.
* @param $chr (int) Char byte.
Expand Down
Loading

0 comments on commit 585ae3d

Please sign in to comment.