Skip to content

Commit fb4e14e

Browse files
committed
Merge branch 'pdfa-validation'
2 parents b65446b + 9e5051e commit fb4e14e

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

examples/example_065.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Last Update : 2013-05-14
66
//
77
// Description : Example 065 for TCPDF class
8-
// Creates an example PDF/A-1b document using TCPDF
8+
// Creates an example PDF/A-3b document using TCPDF
99
//
1010
// Author: Nicola Asuni
1111
//
@@ -17,20 +17,20 @@
1717
//============================================================+
1818

1919
/**
20-
* Creates an example PDF/A-1b document using TCPDF
20+
* Creates an example PDF/A-3b document using TCPDF
2121
* @package com.tecnick.tcpdf
22-
* @abstract TCPDF - Example: PDF/A-1b mode
22+
* @abstract TCPDF - Example: PDF/A-3b mode
2323
* @author Nicola Asuni
2424
* @since 2011-09-28
25-
* @group A-1b
25+
* @group A-3b
2626
* @group pdf
2727
*/
2828

2929
// Include the main TCPDF library (search for installation path).
3030
require_once('tcpdf_include.php');
3131

3232
// create new PDF document
33-
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, true);
33+
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, 3);
3434

3535
// set document information
3636
$pdf->setCreator(PDF_CREATOR);
@@ -80,8 +80,8 @@
8080

8181
// Set some content to print
8282
$html = <<<EOD
83-
<h1>Example of <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a> document in <span style="background-color:#99ccff;color:black;"> PDF/A-1b </span> mode.</h1>
84-
<i>This document conforms to the standard <b>PDF/A-1b (ISO 19005-1:2005)</b>.</i>
83+
<h1>Example of <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a> document in <span style="background-color:#99ccff;color:black;"> PDF/A-3b </span> mode.</h1>
84+
<i>This document conforms to the standard <b>PDF/A-3b (ISO 19005-3:2012)</b>.</i>
8585
<p>Please check the source code documentation and other examples for further information (<a href="http://www.tcpdf.org">http://www.tcpdf.org</a>).</p>
8686
<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>
8787
EOD;

examples/example_066.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
/**
44
* Example 066 for TCPDF library
55
*
6-
* @description Creates an example PDF/A-1b document using TCPDF
6+
* @description Creates an example PDF/A-3b document using TCPDF
77
* @author Nicola Asuni - Tecnick.com LTD <[email protected]>
88
* @license LGPL-3.0
99
*/
1010

1111
/**
12-
* Creates an example PDF/A-1b document using TCPDF
12+
* Creates an example PDF/A-3b document using TCPDF
1313
*
14-
* @abstract TCPDF - Example: PDF/A-1b mode
14+
* @abstract TCPDF - Example: PDF/A-3b mode
1515
* @author Nicola Asuni
1616
* @since 2021-03-26
17-
* @group A-1b
17+
* @group A-3b
1818
* @group pdf
1919
*/
2020

2121
// Include the main TCPDF library (search for installation path).
2222
require_once('tcpdf_include.php');
2323

2424
// create new PDF document
25-
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, true);
25+
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, 3);
2626

2727
// set document information
2828
$pdf->setCreator(PDF_CREATOR);
@@ -73,8 +73,8 @@
7373

7474
// Set some content to print
7575
$html = <<<HTML
76-
<h1>Example of <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a> document in <span style="background-color:#99ccff;color:black;"> PDF/A-1b </span> mode.</h1>
77-
<i>This document conforms to the standard <b>PDF/A-1b (ISO 19005-1:2005)</b>.</i>
76+
<h1>Example of <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a> document in <span style="background-color:#99ccff;color:black;"> PDF/A-3b </span> mode.</h1>
77+
<i>This document conforms to the standard <b>PDF/A-3b (ISO 19005-3:2012)</b>.</i>
7878
<p>Please check the source code documentation and other examples for further information (<a href="http://www.tcpdf.org">http://www.tcpdf.org</a>).</p>
7979
HTML;
8080

examples/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<li>XObject Templates: [<a href="example_062.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
8585
<li>Text stretching and spacing (tracking/kerning): [<a href="example_063.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
8686
<li>No-write page regions: [<a href="example_064.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
87-
<li>PDF/A-1b (ISO 19005-1:2005) document: [<a href="example_065.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
87+
<li>PDF/A-3b (ISO 19005-3:2012) document: [<a href="example_065.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
8888
<li>Using WriteHTMLCell: [<a href="example_066.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
8989
<li>Shorthand border styles including !important: [<a href="example_067.php" title="PDF [new window]" target="_blank">PDF</a>]</li>
9090
</ol>

tests/launch.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ for file in $EXAMPLE_FILES; do
125125
FAILED_FLAG=1
126126
echo "Generated-invalid-file: $file"
127127
fi
128+
if [ "$file" = "examples/example_065.php" ] || [ "$file" = "examples/example_066.php" ]; then
129+
VALIDATION_OUTPUT="$(docker run -v $TEMP_FOLDER:/data --quiet --rm -w /data/ pdfix/verapdf-validation:latest validate --format 'json' -i 'output.pdf')"
130+
VALIDATION_RESULT="$(echo $VALIDATION_OUTPUT | jq '.report.jobs[0].validationResult[0].compliant')"
131+
if [ "$VALIDATION_RESULT" = "false" ]; then
132+
FAILED_FLAG=1
133+
echo "Generated pdf file failed validation: $file"
134+
echo $VALIDATION_OUTPUT
135+
else
136+
VALIDATION_PROFILE="$(echo $VALIDATION_OUTPUT | jq '.report.jobs[0].validationResult[0].profileName')"
137+
echo "Pdf validated with $VALIDATION_PROFILE: $file"
138+
fi
139+
fi
128140
else
129141
FAILED_FLAG=1
130142
echo "File-run-failed: $file"

0 commit comments

Comments
 (0)