Version Description
- Bug: Fix image display problem if filename had a space in it
- Bug: Fix Background Image display problem on Windows OS
- Developer: Added HTML field content to Repeater Field $form_data array
Download this release
Release Info
Developer | Blue Liquid Designs |
Plugin | Gravity PDF |
Version | 6.4.5 |
Comparing to | |
See all releases |
Code changes from version 6.4.4 to 6.4.5
- README.txt +7 -2
- pdf.php +2 -2
- src/Helper/Fields/Field_Repeater.php +14 -0
- src/View/html/PDF/core_template_styles.php +4 -9
- src/assets/languages/gravity-forms-pdf-extended.pot +1 -1
- vendor/composer/installed.json +6 -6
- vendor/composer/installed.php +9 -9
- vendor_prefixed/mpdf/mpdf/src/AssetFetcher.php +1 -1
- vendor_prefixed/mpdf/mpdf/src/CssManager.php +8 -5
- vendor_prefixed/mpdf/mpdf/src/Form.php +3 -14
- vendor_prefixed/mpdf/mpdf/src/Mpdf.php +31 -10
README.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: https://gravitypdf.com/donate-to-plugin/
|
|
5 |
Tags: gravityforms, gravity, forms, pdf, automation, attachment, email
|
6 |
Requires at least: 5.3
|
7 |
Tested up to: 6.0
|
8 |
-
Stable tag: 6.4.
|
9 |
Requires PHP: 7.3
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl.txt
|
@@ -106,7 +106,12 @@ If you aren't able to meet the v6 minimum requirements [you can download v5 whic
|
|
106 |
16. A bunch of paid PDF designs are available, as well as additional functionality.
|
107 |
|
108 |
== Changelog ==
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
110 |
= 6.4.4 =
|
111 |
* Bug: Resolve HTML encoding issue in PDF when displaying Coupon field in Gravity Wiz eCommerce Perk's Product Table
|
112 |
* Bug: Remove coupon line item in PDF when Gravity Wiz eCommerce Perk's Product Table in use
|
5 |
Tags: gravityforms, gravity, forms, pdf, automation, attachment, email
|
6 |
Requires at least: 5.3
|
7 |
Tested up to: 6.0
|
8 |
+
Stable tag: 6.4.5
|
9 |
Requires PHP: 7.3
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl.txt
|
106 |
16. A bunch of paid PDF designs are available, as well as additional functionality.
|
107 |
|
108 |
== Changelog ==
|
109 |
+
|
110 |
+
= 6.4.5 =
|
111 |
+
* Bug: Fix image display problem if filename had a space in it
|
112 |
+
* Bug: Fix Background Image display problem on Windows OS
|
113 |
+
* Developer: Added HTML field content to Repeater Field $form_data array
|
114 |
+
|
115 |
= 6.4.4 =
|
116 |
* Bug: Resolve HTML encoding issue in PDF when displaying Coupon field in Gravity Wiz eCommerce Perk's Product Table
|
117 |
* Bug: Remove coupon line item in PDF when Gravity Wiz eCommerce Perk's Product Table in use
|
pdf.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Gravity PDF
|
4 |
-
Version: 6.4.
|
5 |
Description: Automatically generate highly-customisable PDF documents using Gravity Forms.
|
6 |
Author: Blue Liquid Designs
|
7 |
Author URI: https://blueliquiddesigns.com.au
|
@@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
28 |
/*
|
29 |
* Set base constants we'll use throughout the plugin
|
30 |
*/
|
31 |
-
define( 'PDF_EXTENDED_VERSION', '6.4.
|
32 |
define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
|
33 |
define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
|
34 |
define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Gravity PDF
|
4 |
+
Version: 6.4.5
|
5 |
Description: Automatically generate highly-customisable PDF documents using Gravity Forms.
|
6 |
Author: Blue Liquid Designs
|
7 |
Author URI: https://blueliquiddesigns.com.au
|
28 |
/*
|
29 |
* Set base constants we'll use throughout the plugin
|
30 |
*/
|
31 |
+
define( 'PDF_EXTENDED_VERSION', '6.4.5' ); /* the current plugin version */
|
32 |
define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
|
33 |
define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
|
34 |
define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
|
src/Helper/Fields/Field_Repeater.php
CHANGED
@@ -107,6 +107,20 @@ class Field_Repeater extends Helper_Abstract_Fields {
|
|
107 |
if ( isset( $form_data['field'] ) ) {
|
108 |
$data = array_replace_recursive( $data, [ $id => $form_data['field'] ] );
|
109 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
}
|
112 |
|
107 |
if ( isset( $form_data['field'] ) ) {
|
108 |
$data = array_replace_recursive( $data, [ $id => $form_data['field'] ] );
|
109 |
}
|
110 |
+
|
111 |
+
/* Allow HTML to be included in $form_data */
|
112 |
+
if ( isset( $form_data['html_id'] ) ) {
|
113 |
+
$html = [];
|
114 |
+
/* Extract field id and html content */
|
115 |
+
foreach ( $form_data['html_id'] as $field_id => $content ) {
|
116 |
+
/* Format data, with the exact same order ( label.id,id,label ) with the other fields */
|
117 |
+
$html[ $class->field->label . '.' . $field_id ] = $content;
|
118 |
+
$html[ $field_id ] = $content;
|
119 |
+
$html[ $class->field->label ] = $content;
|
120 |
+
}
|
121 |
+
|
122 |
+
$data = array_replace_recursive( $data, [ $id => $html ] );
|
123 |
+
}
|
124 |
}
|
125 |
}
|
126 |
|
src/View/html/PDF/core_template_styles.php
CHANGED
@@ -31,14 +31,9 @@ $footer = $settings['footer'] ?? '';
|
|
31 |
$first_header = $settings['first_header'] ?? '';
|
32 |
$first_footer = $settings['first_footer'] ?? '';
|
33 |
|
34 |
-
$background_color
|
35 |
-
$background_image
|
36 |
-
|
37 |
-
/* Try convert the background image URL to a local path */
|
38 |
-
$background_image_path = $gfpdf->misc->convert_url_to_path( $background_image );
|
39 |
-
if ( $background_image_path !== false ) {
|
40 |
-
$background_image = $background_image_path;
|
41 |
-
}
|
42 |
|
43 |
$contrast = $gfpdf->misc->get_background_and_border_contrast( $background_color );
|
44 |
$contrast_background_color = $contrast['background'];
|
@@ -71,7 +66,7 @@ $include_product_styles = apply_filters( 'gfpdf_include_product_styles', true, $
|
|
71 |
<?php endif; ?>
|
72 |
|
73 |
<?php if ( ! empty( $background_image ) ) : ?>
|
74 |
-
background-image: url(<?php echo esc_url_raw( $background_image ); ?>) no-repeat 0 0;
|
75 |
background-image-resize: 4;
|
76 |
<?php endif; ?>
|
77 |
}
|
31 |
$first_header = $settings['first_header'] ?? '';
|
32 |
$first_footer = $settings['first_footer'] ?? '';
|
33 |
|
34 |
+
$background_color = $settings['background_color'] ?? '#FFF';
|
35 |
+
$background_image = $settings['background_image'] ?? '';
|
36 |
+
$background_image_path = ! empty( $background_image ) ? $gfpdf->misc->convert_url_to_path( $background_image ) : false;
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
$contrast = $gfpdf->misc->get_background_and_border_contrast( $background_color );
|
39 |
$contrast_background_color = $contrast['background'];
|
66 |
<?php endif; ?>
|
67 |
|
68 |
<?php if ( ! empty( $background_image ) ) : ?>
|
69 |
+
background-image: url(<?php echo $background_image_path !== false ? esc_attr( $background_image_path ) : esc_url_raw( $background_image ); ?>) no-repeat 0 0;
|
70 |
background-image-resize: 4;
|
71 |
<?php endif; ?>
|
72 |
}
|
src/assets/languages/gravity-forms-pdf-extended.pot
CHANGED
@@ -6,7 +6,7 @@ msgstr ""
|
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
9 |
-
"POT-Creation-Date: 2022-08-
|
10 |
"X-Poedit-Basepath: ..\n"
|
11 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
12 |
"X-Poedit-SearchPath-0: .\n"
|
6 |
"MIME-Version: 1.0\n"
|
7 |
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
"Content-Transfer-Encoding: 8bit\n"
|
9 |
+
"POT-Creation-Date: 2022-08-17 01:49+0000\n"
|
10 |
"X-Poedit-Basepath: ..\n"
|
11 |
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
|
12 |
"X-Poedit-SearchPath-0: .\n"
|
vendor/composer/installed.json
CHANGED
@@ -561,17 +561,17 @@
|
|
561 |
},
|
562 |
{
|
563 |
"name": "mpdf/mpdf",
|
564 |
-
"version": "v8.1.
|
565 |
-
"version_normalized": "8.1.
|
566 |
"source": {
|
567 |
"type": "git",
|
568 |
"url": "https://github.com/mpdf/mpdf.git",
|
569 |
-
"reference": "
|
570 |
},
|
571 |
"dist": {
|
572 |
"type": "zip",
|
573 |
-
"url": "https://api.github.com/repos/mpdf/mpdf/zipball/
|
574 |
-
"reference": "
|
575 |
"shasum": ""
|
576 |
},
|
577 |
"require": {
|
@@ -597,7 +597,7 @@
|
|
597 |
"ext-xml": "Needed mainly for SVG manipulation",
|
598 |
"ext-zlib": "Needed for compression of embedded resources, such as fonts"
|
599 |
},
|
600 |
-
"time": "2022-
|
601 |
"type": "library",
|
602 |
"installation-source": "dist",
|
603 |
"autoload": {
|
561 |
},
|
562 |
{
|
563 |
"name": "mpdf/mpdf",
|
564 |
+
"version": "v8.1.2",
|
565 |
+
"version_normalized": "8.1.2.0",
|
566 |
"source": {
|
567 |
"type": "git",
|
568 |
"url": "https://github.com/mpdf/mpdf.git",
|
569 |
+
"reference": "a8a22f4874157e490d41b486053a20bec42e182c"
|
570 |
},
|
571 |
"dist": {
|
572 |
"type": "zip",
|
573 |
+
"url": "https://api.github.com/repos/mpdf/mpdf/zipball/a8a22f4874157e490d41b486053a20bec42e182c",
|
574 |
+
"reference": "a8a22f4874157e490d41b486053a20bec42e182c",
|
575 |
"shasum": ""
|
576 |
},
|
577 |
"require": {
|
597 |
"ext-xml": "Needed mainly for SVG manipulation",
|
598 |
"ext-zlib": "Needed for compression of embedded resources, such as fonts"
|
599 |
},
|
600 |
+
"time": "2022-08-15T08:15:09+00:00",
|
601 |
"type": "library",
|
602 |
"installation-source": "dist",
|
603 |
"autoload": {
|
vendor/composer/installed.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
'name' => 'gravitypdf/gravitypdf',
|
4 |
-
'pretty_version' => '6.4.
|
5 |
-
'version' => '6.4.
|
6 |
-
'reference' => '
|
7 |
'type' => 'library',
|
8 |
'install_path' => __DIR__ . '/../../',
|
9 |
'aliases' => array(),
|
@@ -20,9 +20,9 @@
|
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'gravitypdf/gravitypdf' => array(
|
23 |
-
'pretty_version' => '6.4.
|
24 |
-
'version' => '6.4.
|
25 |
-
'reference' => '
|
26 |
'type' => 'library',
|
27 |
'install_path' => __DIR__ . '/../../',
|
28 |
'aliases' => array(),
|
@@ -83,9 +83,9 @@
|
|
83 |
'dev_requirement' => false,
|
84 |
),
|
85 |
'mpdf/mpdf' => array(
|
86 |
-
'pretty_version' => 'v8.1.
|
87 |
-
'version' => '8.1.
|
88 |
-
'reference' => '
|
89 |
'type' => 'library',
|
90 |
'install_path' => __DIR__ . '/../mpdf/mpdf',
|
91 |
'aliases' => array(),
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
'name' => 'gravitypdf/gravitypdf',
|
4 |
+
'pretty_version' => '6.4.5',
|
5 |
+
'version' => '6.4.5.0',
|
6 |
+
'reference' => '4eda4a5b76ca028da26d96043ae02580dc180b71',
|
7 |
'type' => 'library',
|
8 |
'install_path' => __DIR__ . '/../../',
|
9 |
'aliases' => array(),
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'gravitypdf/gravitypdf' => array(
|
23 |
+
'pretty_version' => '6.4.5',
|
24 |
+
'version' => '6.4.5.0',
|
25 |
+
'reference' => '4eda4a5b76ca028da26d96043ae02580dc180b71',
|
26 |
'type' => 'library',
|
27 |
'install_path' => __DIR__ . '/../../',
|
28 |
'aliases' => array(),
|
83 |
'dev_requirement' => false,
|
84 |
),
|
85 |
'mpdf/mpdf' => array(
|
86 |
+
'pretty_version' => 'v8.1.2',
|
87 |
+
'version' => '8.1.2.0',
|
88 |
+
'reference' => 'a8a22f4874157e490d41b486053a20bec42e182c',
|
89 |
'type' => 'library',
|
90 |
'install_path' => __DIR__ . '/../mpdf/mpdf',
|
91 |
'aliases' => array(),
|
vendor_prefixed/mpdf/mpdf/src/AssetFetcher.php
CHANGED
@@ -36,7 +36,7 @@ class AssetFetcher implements \Psr\Log\LoggerAwareInterface
|
|
36 |
throw new \GFPDF_Vendor\Mpdf\Exception\AssetFetchingException('File contains an invalid stream. Only ' . \implode(', ', $wrapperChecker->getWhitelistedStreamWrappers()) . ' streams are allowed.');
|
37 |
}
|
38 |
$this->mpdf->GetFullPath($path);
|
39 |
-
return $this->isPathLocal($path) ? $this->fetchLocalContent($path, $originalSrc) : $this->fetchRemoteContent($path);
|
40 |
}
|
41 |
public function fetchLocalContent($path, $originalSrc)
|
42 |
{
|
36 |
throw new \GFPDF_Vendor\Mpdf\Exception\AssetFetchingException('File contains an invalid stream. Only ' . \implode(', ', $wrapperChecker->getWhitelistedStreamWrappers()) . ' streams are allowed.');
|
37 |
}
|
38 |
$this->mpdf->GetFullPath($path);
|
39 |
+
return $this->isPathLocal($path) || $originalSrc !== null && $this->isPathLocal($originalSrc) ? $this->fetchLocalContent($path, $originalSrc) : $this->fetchRemoteContent($path);
|
40 |
}
|
41 |
public function fetchLocalContent($path, $originalSrc)
|
42 |
{
|
vendor_prefixed/mpdf/mpdf/src/CssManager.php
CHANGED
@@ -129,8 +129,15 @@ class CssManager
|
|
129 |
$path = \htmlspecialchars_decode($path);
|
130 |
// mPDF 6
|
131 |
$this->mpdf->GetFullPath($path);
|
132 |
-
|
|
|
|
|
|
|
133 |
$CSSextblock = $this->assetFetcher->fetchDataFromPath($path);
|
|
|
|
|
|
|
|
|
134 |
if ($CSSextblock) {
|
135 |
// look for embedded @import stylesheets in other stylesheets
|
136 |
// and fix url paths (including background-images) relative to stylesheet
|
@@ -2050,10 +2057,6 @@ class CssManager
|
|
2050 |
}
|
2051 |
private function normalizePath($path)
|
2052 |
{
|
2053 |
-
// mPDF 5.7.3
|
2054 |
-
if (\strpos($path, '//') === \false) {
|
2055 |
-
$path = \preg_replace('/\\.css\\?.*$/', '.css', $path);
|
2056 |
-
}
|
2057 |
if ($this->mpdf->basepathIsLocal) {
|
2058 |
$tr = \parse_url($path);
|
2059 |
$lp = __FILE__;
|
129 |
$path = \htmlspecialchars_decode($path);
|
130 |
// mPDF 6
|
131 |
$this->mpdf->GetFullPath($path);
|
132 |
+
// mPDF 5.7.3
|
133 |
+
if (\strpos($path, '//') === \false) {
|
134 |
+
$path = \preg_replace('/\\.css\\?.*$/', '.css', $path);
|
135 |
+
}
|
136 |
$CSSextblock = $this->assetFetcher->fetchDataFromPath($path);
|
137 |
+
if (!$CSSextblock) {
|
138 |
+
$path = $this->normalizePath($path);
|
139 |
+
$CSSextblock = $this->assetFetcher->fetchDataFromPath($path);
|
140 |
+
}
|
141 |
if ($CSSextblock) {
|
142 |
// look for embedded @import stylesheets in other stylesheets
|
143 |
// and fix url paths (including background-images) relative to stylesheet
|
2057 |
}
|
2058 |
private function normalizePath($path)
|
2059 |
{
|
|
|
|
|
|
|
|
|
2060 |
if ($this->mpdf->basepathIsLocal) {
|
2061 |
$tr = \parse_url($path);
|
2062 |
$lp = __FILE__;
|
vendor_prefixed/mpdf/mpdf/src/Form.php
CHANGED
@@ -174,11 +174,7 @@ class Form
|
|
174 |
if (isset($objattr['subtype']) && $objattr['subtype'] === 'PASSWORD') {
|
175 |
$flags[] = self::FLAG_PASSWORD;
|
176 |
}
|
177 |
-
|
178 |
-
$this->mpdf->SetTColor($objattr['color']);
|
179 |
-
} else {
|
180 |
-
$this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
181 |
-
}
|
182 |
$fieldalign = $rtlalign;
|
183 |
if (!empty($objattr['text_align'])) {
|
184 |
$fieldalign = $objattr['text_align'];
|
@@ -201,7 +197,6 @@ class Form
|
|
201 |
$js[] = ['K', $objattr['onKeystroke']];
|
202 |
}
|
203 |
$this->SetFormText($w, $h, $objattr['fieldname'], $val, $val, $objattr['title'], $flags, $fieldalign, \false, isset($objattr['maxlength']) ? $objattr['maxlength'] : \false, $js, isset($objattr['background-col']) ? $objattr['background-col'] : \false, isset($objattr['border-col']) ? $objattr['border-col'] : \false);
|
204 |
-
$this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
205 |
} else {
|
206 |
$w -= $this->form_element_spacing['input']['outer']['h'] * 2 / $k;
|
207 |
$h -= $this->form_element_spacing['input']['outer']['v'] * 2 / $k;
|
@@ -215,7 +210,6 @@ class Form
|
|
215 |
if (\preg_match('/([' . $this->mpdf->pregRTLchars . '])/u', $texto)) {
|
216 |
$this->mpdf->biDirectional = \true;
|
217 |
}
|
218 |
-
// *RTL*
|
219 |
// Use OTL OpenType Table Layout - GSUB & GPOS
|
220 |
if (!empty($this->mpdf->CurrentFont['useOTL'])) {
|
221 |
$texto = $this->otl->applyOTL($texto, $this->mpdf->CurrentFont['useOTL']);
|
@@ -303,7 +297,7 @@ class Form
|
|
303 |
$this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
304 |
} else {
|
305 |
$this->mpdf->SetFColor($this->colorConverter->convert(250, $this->mpdf->PDFAXwarnings));
|
306 |
-
$this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
307 |
}
|
308 |
$this->mpdf->Rect($this->mpdf->x, $this->mpdf->y, $w, $h, 'DF');
|
309 |
$ClipPath = \sprintf('q %.3F %.3F %.3F %.3F re W n ', $this->mpdf->x * \GFPDF_Vendor\Mpdf\Mpdf::SCALE, ($this->mpdf->h - $this->mpdf->y) * \GFPDF_Vendor\Mpdf\Mpdf::SCALE, $w * \GFPDF_Vendor\Mpdf\Mpdf::SCALE, -$h * \GFPDF_Vendor\Mpdf\Mpdf::SCALE);
|
@@ -453,11 +447,7 @@ class Form
|
|
453 |
$flags[] = self::FLAG_NO_EXPORT;
|
454 |
$objattr['color'] = [3, 128, 128, 128];
|
455 |
}
|
456 |
-
|
457 |
-
$this->mpdf->SetTColor($objattr['color']);
|
458 |
-
} else {
|
459 |
-
$this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
460 |
-
}
|
461 |
if (isset($objattr['subtype'])) {
|
462 |
if ($objattr['subtype'] === 'RESET') {
|
463 |
$this->SetFormButtonText($objattr['value']);
|
@@ -495,7 +485,6 @@ class Form
|
|
495 |
if (\preg_match('/([' . $this->mpdf->pregRTLchars . '])/u', $texto)) {
|
496 |
$this->mpdf->biDirectional = \true;
|
497 |
}
|
498 |
-
// *RTL*
|
499 |
// Use OTL OpenType Table Layout - GSUB & GPOS
|
500 |
if (!empty($this->mpdf->CurrentFont['useOTL'])) {
|
501 |
$texto = $this->otl->applyOTL($texto, $this->mpdf->CurrentFont['useOTL']);
|
174 |
if (isset($objattr['subtype']) && $objattr['subtype'] === 'PASSWORD') {
|
175 |
$flags[] = self::FLAG_PASSWORD;
|
176 |
}
|
177 |
+
$this->mpdf->SetTColor(isset($objattr['color']) ? $objattr['color'] : $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
|
|
|
|
|
|
|
|
178 |
$fieldalign = $rtlalign;
|
179 |
if (!empty($objattr['text_align'])) {
|
180 |
$fieldalign = $objattr['text_align'];
|
197 |
$js[] = ['K', $objattr['onKeystroke']];
|
198 |
}
|
199 |
$this->SetFormText($w, $h, $objattr['fieldname'], $val, $val, $objattr['title'], $flags, $fieldalign, \false, isset($objattr['maxlength']) ? $objattr['maxlength'] : \false, $js, isset($objattr['background-col']) ? $objattr['background-col'] : \false, isset($objattr['border-col']) ? $objattr['border-col'] : \false);
|
|
|
200 |
} else {
|
201 |
$w -= $this->form_element_spacing['input']['outer']['h'] * 2 / $k;
|
202 |
$h -= $this->form_element_spacing['input']['outer']['v'] * 2 / $k;
|
210 |
if (\preg_match('/([' . $this->mpdf->pregRTLchars . '])/u', $texto)) {
|
211 |
$this->mpdf->biDirectional = \true;
|
212 |
}
|
|
|
213 |
// Use OTL OpenType Table Layout - GSUB & GPOS
|
214 |
if (!empty($this->mpdf->CurrentFont['useOTL'])) {
|
215 |
$texto = $this->otl->applyOTL($texto, $this->mpdf->CurrentFont['useOTL']);
|
297 |
$this->mpdf->SetTColor($this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
298 |
} else {
|
299 |
$this->mpdf->SetFColor($this->colorConverter->convert(250, $this->mpdf->PDFAXwarnings));
|
300 |
+
$this->mpdf->SetTColor(isset($objattr['color']) ? $objattr['color'] : $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
301 |
}
|
302 |
$this->mpdf->Rect($this->mpdf->x, $this->mpdf->y, $w, $h, 'DF');
|
303 |
$ClipPath = \sprintf('q %.3F %.3F %.3F %.3F re W n ', $this->mpdf->x * \GFPDF_Vendor\Mpdf\Mpdf::SCALE, ($this->mpdf->h - $this->mpdf->y) * \GFPDF_Vendor\Mpdf\Mpdf::SCALE, $w * \GFPDF_Vendor\Mpdf\Mpdf::SCALE, -$h * \GFPDF_Vendor\Mpdf\Mpdf::SCALE);
|
447 |
$flags[] = self::FLAG_NO_EXPORT;
|
448 |
$objattr['color'] = [3, 128, 128, 128];
|
449 |
}
|
450 |
+
$this->mpdf->SetTColor(isset($objattr['color']) ? $objattr['color'] : $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings));
|
|
|
|
|
|
|
|
|
451 |
if (isset($objattr['subtype'])) {
|
452 |
if ($objattr['subtype'] === 'RESET') {
|
453 |
$this->SetFormButtonText($objattr['value']);
|
485 |
if (\preg_match('/([' . $this->mpdf->pregRTLchars . '])/u', $texto)) {
|
486 |
$this->mpdf->biDirectional = \true;
|
487 |
}
|
|
|
488 |
// Use OTL OpenType Table Layout - GSUB & GPOS
|
489 |
if (!empty($this->mpdf->CurrentFont['useOTL'])) {
|
490 |
$texto = $this->otl->applyOTL($texto, $this->mpdf->CurrentFont['useOTL']);
|
vendor_prefixed/mpdf/mpdf/src/Mpdf.php
CHANGED
@@ -4,7 +4,6 @@ namespace GFPDF_Vendor\Mpdf;
|
|
4 |
|
5 |
use GFPDF_Vendor\Mpdf\Config\ConfigVariables;
|
6 |
use GFPDF_Vendor\Mpdf\Config\FontVariables;
|
7 |
-
use GFPDF_Vendor\Mpdf\Container\SimpleContainer;
|
8 |
use GFPDF_Vendor\Mpdf\Conversion;
|
9 |
use GFPDF_Vendor\Mpdf\Css\Border;
|
10 |
use GFPDF_Vendor\Mpdf\Css\TextVars;
|
@@ -29,7 +28,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
29 |
{
|
30 |
use Strict;
|
31 |
use FpdiTrait;
|
32 |
-
const VERSION = '8.1.
|
33 |
const SCALE = 72 / 25.4;
|
34 |
var $useFixedNormalLineHeight;
|
35 |
// mPDF 6
|
@@ -7862,7 +7861,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
7862 |
// Automatic width and height calculation if needed
|
7863 |
if ($w == 0 and $h == 0) {
|
7864 |
/* -- IMAGES-WMF -- */
|
7865 |
-
if ($info['type']
|
7866 |
// WMF units are twips (1/20pt)
|
7867 |
// divide by 20 to get points
|
7868 |
// divide by k to get user units
|
@@ -7870,7 +7869,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
7870 |
$h = \abs($info['h']) / (20 * \GFPDF_Vendor\Mpdf\Mpdf::SCALE);
|
7871 |
} else {
|
7872 |
/* -- END IMAGES-WMF -- */
|
7873 |
-
if ($info['type']
|
7874 |
// returned SVG units are pts
|
7875 |
// divide by k to get user units (mm)
|
7876 |
$w = \abs($info['w']) / \GFPDF_Vendor\Mpdf\Mpdf::SCALE;
|
@@ -8553,6 +8552,28 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
8553 |
}
|
8554 |
$this->cache->clearOld();
|
8555 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8556 |
// *****************************************************************************
|
8557 |
// *
|
8558 |
// Protected methods *
|
@@ -10142,7 +10163,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
10142 |
}
|
10143 |
$path = \preg_replace('|^./|', '', $path);
|
10144 |
// Inadvertently corrects "./path/etc" and "//www.domain.com/etc"
|
10145 |
-
if (\
|
10146 |
return;
|
10147 |
}
|
10148 |
// Skip schemes not supported by installed stream wrappers
|
@@ -10151,11 +10172,11 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
10151 |
if (\preg_match($pattern, $path)) {
|
10152 |
return;
|
10153 |
}
|
10154 |
-
if (\
|
10155 |
// It is a relative link
|
10156 |
-
$backtrackamount = \substr_count($path,
|
10157 |
-
$maxbacktrack = \substr_count($basepath,
|
10158 |
-
$filepath = \str_replace(
|
10159 |
$path = $basepath;
|
10160 |
// If it is an invalid relative link, then make it go to directory root
|
10161 |
if ($backtrackamount > $maxbacktrack) {
|
@@ -10171,7 +10192,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
10171 |
}
|
10172 |
if ((\strpos($path, ":/") === \false || \strpos($path, ":/") > 10) && !@\is_file($path)) {
|
10173 |
// It is a local link. Ignore potential file errors
|
10174 |
-
if (\
|
10175 |
$tr = \parse_url($basepath);
|
10176 |
// mPDF 5.7.2
|
10177 |
$root = '';
|
4 |
|
5 |
use GFPDF_Vendor\Mpdf\Config\ConfigVariables;
|
6 |
use GFPDF_Vendor\Mpdf\Config\FontVariables;
|
|
|
7 |
use GFPDF_Vendor\Mpdf\Conversion;
|
8 |
use GFPDF_Vendor\Mpdf\Css\Border;
|
9 |
use GFPDF_Vendor\Mpdf\Css\TextVars;
|
28 |
{
|
29 |
use Strict;
|
30 |
use FpdiTrait;
|
31 |
+
const VERSION = '8.1.2';
|
32 |
const SCALE = 72 / 25.4;
|
33 |
var $useFixedNormalLineHeight;
|
34 |
// mPDF 6
|
7861 |
// Automatic width and height calculation if needed
|
7862 |
if ($w == 0 and $h == 0) {
|
7863 |
/* -- IMAGES-WMF -- */
|
7864 |
+
if ($info['type'] === 'wmf') {
|
7865 |
// WMF units are twips (1/20pt)
|
7866 |
// divide by 20 to get points
|
7867 |
// divide by k to get user units
|
7869 |
$h = \abs($info['h']) / (20 * \GFPDF_Vendor\Mpdf\Mpdf::SCALE);
|
7870 |
} else {
|
7871 |
/* -- END IMAGES-WMF -- */
|
7872 |
+
if ($info['type'] === 'svg') {
|
7873 |
// returned SVG units are pts
|
7874 |
// divide by k to get user units (mm)
|
7875 |
$w = \abs($info['w']) / \GFPDF_Vendor\Mpdf\Mpdf::SCALE;
|
8552 |
}
|
8553 |
$this->cache->clearOld();
|
8554 |
}
|
8555 |
+
public function OutputBinaryData()
|
8556 |
+
{
|
8557 |
+
return $this->Output(null, \GFPDF_Vendor\Mpdf\Output\Destination::STRING_RETURN);
|
8558 |
+
}
|
8559 |
+
public function OutputHttpInline()
|
8560 |
+
{
|
8561 |
+
return $this->Output(null, \GFPDF_Vendor\Mpdf\Output\Destination::INLINE);
|
8562 |
+
}
|
8563 |
+
/**
|
8564 |
+
* @param string $fileName
|
8565 |
+
*/
|
8566 |
+
public function OutputHttpDownload($fileName)
|
8567 |
+
{
|
8568 |
+
return $this->Output($fileName, \GFPDF_Vendor\Mpdf\Output\Destination::DOWNLOAD);
|
8569 |
+
}
|
8570 |
+
/**
|
8571 |
+
* @param string $fileName
|
8572 |
+
*/
|
8573 |
+
public function OutputFile($fileName)
|
8574 |
+
{
|
8575 |
+
return $this->Output($fileName, \GFPDF_Vendor\Mpdf\Output\Destination::FILE);
|
8576 |
+
}
|
8577 |
// *****************************************************************************
|
8578 |
// *
|
8579 |
// Protected methods *
|
10163 |
}
|
10164 |
$path = \preg_replace('|^./|', '', $path);
|
10165 |
// Inadvertently corrects "./path/etc" and "//www.domain.com/etc"
|
10166 |
+
if (\strpos($path, '#') === 0) {
|
10167 |
return;
|
10168 |
}
|
10169 |
// Skip schemes not supported by installed stream wrappers
|
10172 |
if (\preg_match($pattern, $path)) {
|
10173 |
return;
|
10174 |
}
|
10175 |
+
if (\strpos($path, '../') === 0) {
|
10176 |
// It is a relative link
|
10177 |
+
$backtrackamount = \substr_count($path, '../');
|
10178 |
+
$maxbacktrack = \substr_count($basepath, '/') - 3;
|
10179 |
+
$filepath = \str_replace('../', '', $path);
|
10180 |
$path = $basepath;
|
10181 |
// If it is an invalid relative link, then make it go to directory root
|
10182 |
if ($backtrackamount > $maxbacktrack) {
|
10192 |
}
|
10193 |
if ((\strpos($path, ":/") === \false || \strpos($path, ":/") > 10) && !@\is_file($path)) {
|
10194 |
// It is a local link. Ignore potential file errors
|
10195 |
+
if (\strpos($path, '/') === 0) {
|
10196 |
$tr = \parse_url($basepath);
|
10197 |
// mPDF 5.7.2
|
10198 |
$root = '';
|