mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-03-21 22:49:39 +01:00
new setExtraXMPRDF function to set custom RDF XMP data
This commit is contained in:
parent
b00a4ed46c
commit
b41a5ca311
@ -6,6 +6,8 @@
|
||||
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.
|
||||
|
||||
2002-2019 Nicola Asuni - Tecnick.com LTD
|
||||
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
* **category** Library
|
||||
* **author** Nicola Asuni <info@tecnick.com>
|
||||
* **copyright** 2002-2018 Nicola Asuni - Tecnick.com LTD
|
||||
* **copyright** 2002-2019 Nicola Asuni - Tecnick.com LTD
|
||||
* **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
|
||||
* **link** http://www.tcpdf.org
|
||||
* **source** https://github.com/tecnickcom/TCPDF
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tecnickcom/tcpdf",
|
||||
"version": "6.2.26",
|
||||
"version": "6.3.0",
|
||||
"homepage": "http://www.tcpdf.org/",
|
||||
"type": "library",
|
||||
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
|
||||
|
BIN
include/sRGB.icc
BIN
include/sRGB.icc
Binary file not shown.
35
tcpdf.php
35
tcpdf.php
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf.php
|
||||
// Version : 6.2.26
|
||||
// Version : 6.3.0
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2018-09-14
|
||||
// Last Update : 2019-09-19
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
// Copyright (C) 2002-2018 Nicola Asuni - Tecnick.com LTD
|
||||
// Copyright (C) 2002-2019 Nicola Asuni - Tecnick.com LTD
|
||||
//
|
||||
// This file is part of TCPDF software library.
|
||||
//
|
||||
@ -104,7 +104,7 @@
|
||||
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @author Nicola Asuni
|
||||
* @version 6.2.26
|
||||
* @version 6.3.0
|
||||
*/
|
||||
|
||||
// TCPDF configuration
|
||||
@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.php');
|
||||
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
|
||||
* @package com.tecnick.tcpdf
|
||||
* @brief PHP class for generating PDF documents without requiring external extensions.
|
||||
* @version 6.2.26
|
||||
* @version 6.3.0
|
||||
* @author Nicola Asuni - info@tecnick.com
|
||||
* @IgnoreAnnotation("protected")
|
||||
* @IgnoreAnnotation("public")
|
||||
@ -1788,6 +1788,13 @@ class TCPDF {
|
||||
*/
|
||||
protected $custom_xmp = '';
|
||||
|
||||
/**
|
||||
* Custom XMP RDF data.
|
||||
* @protected
|
||||
* @since 6.3.0 (2019-09-19)
|
||||
*/
|
||||
protected $custom_xmp_rdf = '';
|
||||
|
||||
/**
|
||||
* Overprint mode array.
|
||||
* (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008).
|
||||
@ -1999,6 +2006,7 @@ class TCPDF {
|
||||
$this->default_graphic_vars = $this->getGraphicVars();
|
||||
$this->header_xobj_autoreset = false;
|
||||
$this->custom_xmp = '';
|
||||
$this->custom_xmp_rdf = '';
|
||||
// Call cleanup method after script execution finishes or exit() is called.
|
||||
// NOTE: This will not be executed if the process is killed with a SIGTERM or SIGKILL signal.
|
||||
register_shutdown_function(array($this, '_destroy'), true);
|
||||
@ -7788,6 +7796,9 @@ class TCPDF {
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
foreach($this->imagekeys as $file) {
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
$preserve = array(
|
||||
'file_id',
|
||||
@ -8401,7 +8412,7 @@ class TCPDF {
|
||||
if (is_string($pl['txt']) && !empty($pl['txt'])) {
|
||||
if ($pl['txt'][0] == '#') {
|
||||
// internal destination
|
||||
$annots .= ' /Dest /'.TCPDF_STATIC::encodeNameObject(substr($pl['txt'], 1));
|
||||
$annots .= ' /A <</S /GoTo /D '.TCPDF_STATIC::encodeNameObject(substr($pl['txt'], 1)).'>>';
|
||||
} elseif ($pl['txt'][0] == '%') {
|
||||
// embedded PDF file
|
||||
$filename = basename(substr($pl['txt'], 1));
|
||||
@ -9533,6 +9544,17 @@ class TCPDF {
|
||||
$this->custom_xmp = $xmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set additional XMP data to be added on the default XMP data just before the end of "rdf:RDF" tag.
|
||||
* IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method!
|
||||
* @param $xmp (string) Custom XMP RDF data.
|
||||
* @since 6.3.0 (2019-09-19)
|
||||
* @public
|
||||
*/
|
||||
public function setExtraXMPRDF($xmp) {
|
||||
$this->custom_xmp_rdf = $xmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put XMP data object and return ID.
|
||||
* @return (int) The object ID.
|
||||
@ -9660,6 +9682,7 @@ class TCPDF {
|
||||
$xmp .= "\t\t\t\t".'</rdf:Bag>'."\n";
|
||||
$xmp .= "\t\t\t".'</pdfaExtension:schemas>'."\n";
|
||||
$xmp .= "\t\t".'</rdf:Description>'."\n";
|
||||
$xmp .= $this->custom_xmp_rdf;
|
||||
$xmp .= "\t".'</rdf:RDF>'."\n";
|
||||
$xmp .= $this->custom_xmp;
|
||||
$xmp .= '</x:xmpmeta>'."\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user