Version Description
- Upgrade Mpdf from 7.1.6 to 7.1.7 https://github.com/mpdf/mpdf/compare/v7.1.6...v7.1.7
- Allow Debug messages to be logged in Gravity PDF log file
- Add log file message when the PDF Temporary Directory check fails
- Ensure backwards compatibility with legacy templates who access Mpdf properties directly
- When sending notifications, ensure PDF settings go through same filters as when viewing / downloading PDFs
Download this release
Release Info
Developer | Blue Liquid Designs |
Plugin | Gravity PDF |
Version | 5.1.2 |
Comparing to | |
See all releases |
Code changes from version 5.1.1 to 5.1.2
- README.txt +177 -170
- pdf.php +2 -2
- src/assets/languages/gravity-forms-pdf-extended.pot +3 -3
- src/deprecated.php +17 -0
- src/helper/Helper_Logger.php +1 -1
- src/model/Model_PDF.php +4 -1
- src/model/Model_Settings.php +9 -0
- vendor/composer/autoload_classmap.php +1 -0
- vendor/composer/autoload_files.php +1 -1
- vendor/composer/autoload_static.php +2 -1
- vendor/composer/installed.json +9 -9
- vendor/mpdf/mpdf/.travis.yml +9 -1
- vendor/mpdf/mpdf/composer.json +2 -2
- vendor/mpdf/mpdf/src/Barcode.php +33 -67
- vendor/mpdf/mpdf/src/CssManager.php +7 -1
- vendor/mpdf/mpdf/src/Form.php +6 -2
- vendor/mpdf/mpdf/src/HTMLParserMode.php +46 -0
- vendor/mpdf/mpdf/src/Mpdf.php +72 -61
- vendor/mpdf/mpdf/src/Otl.php +2 -2
- vendor/mpdf/mpdf/src/Writer/BackgroundWriter.php +2 -2
README.txt
CHANGED
@@ -1,170 +1,177 @@
|
|
1 |
-
=== Gravity PDF ===
|
2 |
-
Contributors: blue-liquid-designs
|
3 |
-
Plugin URI: https://gravitypdf.com/
|
4 |
-
Donate link: https://gravitypdf.com/donate-to-plugin/
|
5 |
-
Tags: gravity, forms, pdf, automation, attachment, email
|
6 |
-
Requires at least: 4.8
|
7 |
-
Tested up to: 5.0
|
8 |
-
Stable tag: 5.1.
|
9 |
-
Requires PHP: 5.6
|
10 |
-
License: GPLv2 or later
|
11 |
-
License URI: http://www.gnu.org/licenses/gpl.txt
|
12 |
-
|
13 |
-
Automatically generate, email and download PDF documents with Gravity Forms and Gravity PDF.
|
14 |
-
|
15 |
-
== Description ==
|
16 |
-
|
17 |
-
**Gravity PDF is the ultimate solution for generating digital PDF documents using Gravity Forms and WordPress.**
|
18 |
-
|
19 |
-
https://www.youtube.com/watch?v=z8zKKrjmNjY
|
20 |
-
|
21 |
-
The plugin ships with four highly-customisable PDF templates perfectly suited for displaying your user’s data. Within seconds you can personalise the documents with your company logo, change the font, size, color and the paper size. If the templates don't suit, [have one tailor made just for you](https://gravitypdf.com/integration-services/) or [roll your own](https://gravitypdf.com/documentation/v5/developer-start-customising/).
|
22 |
-
|
23 |
-
> Digital document management with WordPress and Gravity Forms just became a breeze!
|
24 |
-
|
25 |
-
= Feature =
|
26 |
-
|
27 |
-
* There’s no third-party APIs needed when generating your PDFs. That means no chance of third-party data breaches, no monthly fees or rate limits. You control the software and the documents it generates.
|
28 |
-
* We support all languages, including complex symbol-based languages like Chinese and Japanese, as well as Right to Left (RTL) written languages such as Arabic and Hebrew.
|
29 |
-
* Automatically email your PDF when a user completes a form. Have it emailed to people in your organisation, the user, or both. You can also conditionally generate and email the PDF.
|
30 |
-
* Using Gravity Forms developer-licensed payment add-ons – like PayPal, Authorize.net or Stripe – you can restrict access to the PDF until after a payment is captured.
|
31 |
-
* [Protecting your user’s sensitive information is at the heart of Gravity PDF](https://gravitypdf.com/documentation/v5/user-pdf-security/). The plugin’s security settings give you granular control over who has access to the PDFs generated.
|
32 |
-
* Our [JavaScript-powered font manager](https://gravitypdf.com/documentation/v5/user-custom-fonts/) allows you to install and use your favorite fonts. Now you can keep in line with your corporate style guide, or create beautiful PDF typography.
|
33 |
-
* [The documentation](https://gravitypdf.com/documentation/v5/user-installation/) has everything from basic install instructions to advanced developer how-to guides. Our friendly team is also on hand to [provide FREE general support](https://gravitypdf.com/support/).
|
34 |
-
* PHP, HTML and CSS come easy? [You’ll find creating your own PDF templates a breeze](https://gravitypdf.com/documentation/v5/developer-start-customising/). If not, [we offer PDF design services](https://gravitypdf.com/integration-services/) tailored just for you. We can even auto-fill existing PDFs!
|
35 |
-
|
36 |
-
= Premium Extensions and Templates =
|
37 |
-
|
38 |
-
[Unlock more features for Gravity PDF with one of our premium extensions](https://gravitypdf.com/extension-shop/). If one of the free PDF templates aren't working for you, [try a premium template instead](https://gravitypdf.com/template-shop/). All purchases have a 7-day 100% money back guarantee.
|
39 |
-
|
40 |
-
= Requirements =
|
41 |
-
|
42 |
-
Gravity PDF can be run on most shared web hosting without any issues. It requires **PHP 5.6+** (PHP 7.0+ recommended) and at least 64MB of WP Memory (128MB+ recommended). You'll also need to be running WordPress 4.8+ and have [Gravity Forms 2.3.1+](https://rocketgenius.pxf.io/c/1211356/445235/7938) (affiliate link).
|
43 |
-
|
44 |
-
If you aren't sure Gravity PDF will meet your needs (and haven't got a Gravity Forms license yet) you can [try out the software via our demo site](https://demo.gravitypdf.com).
|
45 |
-
|
46 |
-
= Documentation & Support =
|
47 |
-
|
48 |
-
[We have extensive documentation on using Gravity PDF](https://gravitypdf.com/documentation/v5/five-minute-install/), and our friendly support team provides [FREE basic support via our website](https://gravitypdf.com/support/#contact-support) (we also check the WordPress.org forums but submitting a ticket via GravityPDF.com will get a faster response).
|
49 |
-
|
50 |
-
= Custom PDF Integration =
|
51 |
-
|
52 |
-
We offer **comprehensive PDF integration services** and do all the PDF development and integration into Gravity Forms for you. You tell us what you want and our friendly and experienced developers will design, develop and install custom PDF templates tailor specifically for you. We can even auto-fill your existing PDF documents. [Find out more at GravityPDF.com](https://gravitypdf.com/integration-services/).
|
53 |
-
|
54 |
-
= Contribute =
|
55 |
-
|
56 |
-
All development for Gravity PDF [is handled via GitHub](https://github.com/GravityPDF/gravity-pdf/). Opening new issues and submitting pull requests are welcome.
|
57 |
-
|
58 |
-
[Our public roadmap is available on Trello](https://trello.com/b/60YGv1J3/roadmap). We'd love it if you vote and comment on your favorite ideas.
|
59 |
-
|
60 |
-
You can also keep up to date with Gravity PDF by [subscribing to our newsletter](https://gravitypdf.com/#signup-top), [following us on Twitter](https://twitter.com/gravitypdf) or [liking us on Facebook](https://www.facebook.com/gravitypdf).
|
61 |
-
|
62 |
-
Also, if you enjoy using the software [we'd love it if you could give us a review!](https://wordpress.org/support/view/plugin-reviews/gravity-forms-pdf-extended)
|
63 |
-
|
64 |
-
*Note: When Gravity Forms isn't installed and you activate Gravity PDF we display a notice that includes an affiliate link to their website.*
|
65 |
-
|
66 |
-
== Installation ==
|
67 |
-
|
68 |
-
[You'll find detailed installation instructions on GravityPDF.com](https://gravitypdf.com/documentation/v5/user-installation/).
|
69 |
-
|
70 |
-
== Screenshots ==
|
71 |
-
|
72 |
-
1. Our on-boarding experience will have you up and running in 5 minutes flat.
|
73 |
-
2. Set up the global PDF settings then head straight to configuring your first PDF.
|
74 |
-
3. Control the default paper size, PDF template and font/size/color.
|
75 |
-
4. Advanced security options give you granular control of PDF access.
|
76 |
-
5. Tools like the font manager and custom PDF installer are readily accessible.
|
77 |
-
6. Our JavaScript-powered font manager will make using custom fonts a breeze.
|
78 |
-
7. A snapshot of your form’s PDF setup.
|
79 |
-
8. When adding a new PDF all the important settings are up front in the “General” tab.
|
80 |
-
9. Override the default appearance settings on a per-PDF basis.
|
81 |
-
10. Each template has its own PDF settings for greater control of the look and feel of your document.
|
82 |
-
11. Header and Footer support is built-in.
|
83 |
-
12. Advanced format and security settings can be applied to individual PDFs.
|
84 |
-
13. PDFs can be accessed from the Gravity Forms entry list page.
|
85 |
-
14. They also appear on the individual entry pages for easy access.
|
86 |
-
15. Zadani is a minimalist business-style template that will generate a well-spaced document great for printing.
|
87 |
-
16. Rubix uses stylish containers to create an aesthetically pleasing design.
|
88 |
-
17. Focus Gravity providing a classic layout which epitomises Gravity Forms Print Preview. It’s the familiar layout you’ve come to love.
|
89 |
-
18. Blank Slate provides a print-friendly template focusing solely on the user-submitted data.
|
90 |
-
|
91 |
-
== Changelog ==
|
92 |
-
|
93 |
-
= 5.1.
|
94 |
-
*
|
95 |
-
*
|
96 |
-
*
|
97 |
-
*
|
98 |
-
*
|
99 |
-
|
100 |
-
= 5.1.
|
101 |
-
*
|
102 |
-
*
|
103 |
-
*
|
104 |
-
*
|
105 |
-
*
|
106 |
-
|
107 |
-
|
108 |
-
*
|
109 |
-
*
|
110 |
-
*
|
111 |
-
*
|
112 |
-
*
|
113 |
-
|
114 |
-
|
115 |
-
*
|
116 |
-
*
|
117 |
-
*
|
118 |
-
*
|
119 |
-
*
|
120 |
-
|
121 |
-
|
122 |
-
* Bug:
|
123 |
-
|
124 |
-
|
125 |
-
* Bug:
|
126 |
-
* Bug:
|
127 |
-
|
128 |
-
= 5.0.
|
129 |
-
*
|
130 |
-
|
131 |
-
|
132 |
-
*
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
*
|
137 |
-
*
|
138 |
-
*
|
139 |
-
*
|
140 |
-
|
141 |
-
*
|
142 |
-
*
|
143 |
-
*
|
144 |
-
*
|
145 |
-
*
|
146 |
-
*
|
147 |
-
|
148 |
-
*
|
149 |
-
*
|
150 |
-
*
|
151 |
-
*
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Gravity PDF ===
|
2 |
+
Contributors: blue-liquid-designs
|
3 |
+
Plugin URI: https://gravitypdf.com/
|
4 |
+
Donate link: https://gravitypdf.com/donate-to-plugin/
|
5 |
+
Tags: gravity, forms, pdf, automation, attachment, email
|
6 |
+
Requires at least: 4.8
|
7 |
+
Tested up to: 5.0
|
8 |
+
Stable tag: 5.1.2
|
9 |
+
Requires PHP: 5.6
|
10 |
+
License: GPLv2 or later
|
11 |
+
License URI: http://www.gnu.org/licenses/gpl.txt
|
12 |
+
|
13 |
+
Automatically generate, email and download PDF documents with Gravity Forms and Gravity PDF.
|
14 |
+
|
15 |
+
== Description ==
|
16 |
+
|
17 |
+
**Gravity PDF is the ultimate solution for generating digital PDF documents using Gravity Forms and WordPress.**
|
18 |
+
|
19 |
+
https://www.youtube.com/watch?v=z8zKKrjmNjY
|
20 |
+
|
21 |
+
The plugin ships with four highly-customisable PDF templates perfectly suited for displaying your user’s data. Within seconds you can personalise the documents with your company logo, change the font, size, color and the paper size. If the templates don't suit, [have one tailor made just for you](https://gravitypdf.com/integration-services/) or [roll your own](https://gravitypdf.com/documentation/v5/developer-start-customising/).
|
22 |
+
|
23 |
+
> Digital document management with WordPress and Gravity Forms just became a breeze!
|
24 |
+
|
25 |
+
= Feature =
|
26 |
+
|
27 |
+
* There’s no third-party APIs needed when generating your PDFs. That means no chance of third-party data breaches, no monthly fees or rate limits. You control the software and the documents it generates.
|
28 |
+
* We support all languages, including complex symbol-based languages like Chinese and Japanese, as well as Right to Left (RTL) written languages such as Arabic and Hebrew.
|
29 |
+
* Automatically email your PDF when a user completes a form. Have it emailed to people in your organisation, the user, or both. You can also conditionally generate and email the PDF.
|
30 |
+
* Using Gravity Forms developer-licensed payment add-ons – like PayPal, Authorize.net or Stripe – you can restrict access to the PDF until after a payment is captured.
|
31 |
+
* [Protecting your user’s sensitive information is at the heart of Gravity PDF](https://gravitypdf.com/documentation/v5/user-pdf-security/). The plugin’s security settings give you granular control over who has access to the PDFs generated.
|
32 |
+
* Our [JavaScript-powered font manager](https://gravitypdf.com/documentation/v5/user-custom-fonts/) allows you to install and use your favorite fonts. Now you can keep in line with your corporate style guide, or create beautiful PDF typography.
|
33 |
+
* [The documentation](https://gravitypdf.com/documentation/v5/user-installation/) has everything from basic install instructions to advanced developer how-to guides. Our friendly team is also on hand to [provide FREE general support](https://gravitypdf.com/support/).
|
34 |
+
* PHP, HTML and CSS come easy? [You’ll find creating your own PDF templates a breeze](https://gravitypdf.com/documentation/v5/developer-start-customising/). If not, [we offer PDF design services](https://gravitypdf.com/integration-services/) tailored just for you. We can even auto-fill existing PDFs!
|
35 |
+
|
36 |
+
= Premium Extensions and Templates =
|
37 |
+
|
38 |
+
[Unlock more features for Gravity PDF with one of our premium extensions](https://gravitypdf.com/extension-shop/). If one of the free PDF templates aren't working for you, [try a premium template instead](https://gravitypdf.com/template-shop/). All purchases have a 7-day 100% money back guarantee.
|
39 |
+
|
40 |
+
= Requirements =
|
41 |
+
|
42 |
+
Gravity PDF can be run on most shared web hosting without any issues. It requires **PHP 5.6+** (PHP 7.0+ recommended) and at least 64MB of WP Memory (128MB+ recommended). You'll also need to be running WordPress 4.8+ and have [Gravity Forms 2.3.1+](https://rocketgenius.pxf.io/c/1211356/445235/7938) (affiliate link).
|
43 |
+
|
44 |
+
If you aren't sure Gravity PDF will meet your needs (and haven't got a Gravity Forms license yet) you can [try out the software via our demo site](https://demo.gravitypdf.com).
|
45 |
+
|
46 |
+
= Documentation & Support =
|
47 |
+
|
48 |
+
[We have extensive documentation on using Gravity PDF](https://gravitypdf.com/documentation/v5/five-minute-install/), and our friendly support team provides [FREE basic support via our website](https://gravitypdf.com/support/#contact-support) (we also check the WordPress.org forums but submitting a ticket via GravityPDF.com will get a faster response).
|
49 |
+
|
50 |
+
= Custom PDF Integration =
|
51 |
+
|
52 |
+
We offer **comprehensive PDF integration services** and do all the PDF development and integration into Gravity Forms for you. You tell us what you want and our friendly and experienced developers will design, develop and install custom PDF templates tailor specifically for you. We can even auto-fill your existing PDF documents. [Find out more at GravityPDF.com](https://gravitypdf.com/integration-services/).
|
53 |
+
|
54 |
+
= Contribute =
|
55 |
+
|
56 |
+
All development for Gravity PDF [is handled via GitHub](https://github.com/GravityPDF/gravity-pdf/). Opening new issues and submitting pull requests are welcome.
|
57 |
+
|
58 |
+
[Our public roadmap is available on Trello](https://trello.com/b/60YGv1J3/roadmap). We'd love it if you vote and comment on your favorite ideas.
|
59 |
+
|
60 |
+
You can also keep up to date with Gravity PDF by [subscribing to our newsletter](https://gravitypdf.com/#signup-top), [following us on Twitter](https://twitter.com/gravitypdf) or [liking us on Facebook](https://www.facebook.com/gravitypdf).
|
61 |
+
|
62 |
+
Also, if you enjoy using the software [we'd love it if you could give us a review!](https://wordpress.org/support/view/plugin-reviews/gravity-forms-pdf-extended)
|
63 |
+
|
64 |
+
*Note: When Gravity Forms isn't installed and you activate Gravity PDF we display a notice that includes an affiliate link to their website.*
|
65 |
+
|
66 |
+
== Installation ==
|
67 |
+
|
68 |
+
[You'll find detailed installation instructions on GravityPDF.com](https://gravitypdf.com/documentation/v5/user-installation/).
|
69 |
+
|
70 |
+
== Screenshots ==
|
71 |
+
|
72 |
+
1. Our on-boarding experience will have you up and running in 5 minutes flat.
|
73 |
+
2. Set up the global PDF settings then head straight to configuring your first PDF.
|
74 |
+
3. Control the default paper size, PDF template and font/size/color.
|
75 |
+
4. Advanced security options give you granular control of PDF access.
|
76 |
+
5. Tools like the font manager and custom PDF installer are readily accessible.
|
77 |
+
6. Our JavaScript-powered font manager will make using custom fonts a breeze.
|
78 |
+
7. A snapshot of your form’s PDF setup.
|
79 |
+
8. When adding a new PDF all the important settings are up front in the “General” tab.
|
80 |
+
9. Override the default appearance settings on a per-PDF basis.
|
81 |
+
10. Each template has its own PDF settings for greater control of the look and feel of your document.
|
82 |
+
11. Header and Footer support is built-in.
|
83 |
+
12. Advanced format and security settings can be applied to individual PDFs.
|
84 |
+
13. PDFs can be accessed from the Gravity Forms entry list page.
|
85 |
+
14. They also appear on the individual entry pages for easy access.
|
86 |
+
15. Zadani is a minimalist business-style template that will generate a well-spaced document great for printing.
|
87 |
+
16. Rubix uses stylish containers to create an aesthetically pleasing design.
|
88 |
+
17. Focus Gravity providing a classic layout which epitomises Gravity Forms Print Preview. It’s the familiar layout you’ve come to love.
|
89 |
+
18. Blank Slate provides a print-friendly template focusing solely on the user-submitted data.
|
90 |
+
|
91 |
+
== Changelog ==
|
92 |
+
|
93 |
+
= 5.1.2 =
|
94 |
+
* Upgrade Mpdf from 7.1.6 to 7.1.7 https://github.com/mpdf/mpdf/compare/v7.1.6...v7.1.7
|
95 |
+
* Allow Debug messages to be logged in Gravity PDF log file
|
96 |
+
* Add log file message when the PDF Temporary Directory check fails
|
97 |
+
* Ensure backwards compatibility with legacy templates who access Mpdf properties directly
|
98 |
+
* When sending notifications, ensure PDF settings go through same filters as when viewing / downloading PDFs
|
99 |
+
|
100 |
+
= 5.1.1 =
|
101 |
+
* Bug: Process Merge Tags when displaying Nested Forms in Core / Universal PDFs [GH#849]
|
102 |
+
* Bug: Don't strip `<pagebreak />`, `<barcode />`, `<table autosize="1">`, and `page-break-*` CSS when displaying Rich Text Editor fields in PDF [GH#852]
|
103 |
+
* Bug: Try convert the Background Image URL to a Path for better relability [GH#853]
|
104 |
+
* Bug: Fix Rich Text Editor display issue in PDF Settings when Elementor plugin enabled [GH#854]
|
105 |
+
* Bug: Don't strip `<a>` tag when direct parent of `<img />` in the Core/Universal PDFs Header and Footer Rich Text Editor [GH#855]
|
106 |
+
|
107 |
+
= 5.1.0 =
|
108 |
+
* Feature: Add support for Gravity Forms Repeater Fields in PDFs [GH#833]
|
109 |
+
* Feature: Add support for Gravity Wiz's Nested Forms Perk in PDFs
|
110 |
+
* Feature: Add support for Gravity Forms Consent Field in PDFs [GH#832]
|
111 |
+
* Feature: Add signed-URL authentication to [gravitypdf] shortcode using new "signed" and "expires" attributes [GH#841]
|
112 |
+
* Feature: Add new "raw" attribute to the [gravitypdf] shortcode which will display the raw PDF URL [GH#841]
|
113 |
+
* Feature: Added "Debug Mode" Global PDF Setting which replaces "Shortcode Debug Message", WP_DEBUG settings, and caches the template headers [GH#823]
|
114 |
+
|
115 |
+
* Dev Feature: Add `gfpdf_disable_global_addon_data` filter to disable aggregate Survey / Poll / Quiz data in $form_data array (for performance)
|
116 |
+
* Dev Feature: Add `gfpdf_disable_product_table` filter to disable Product table in PDF [GH#827]
|
117 |
+
* Dev Feature: Pass additional parameters to the `gfpdf_show_field_value` filter
|
118 |
+
* Dev Feature: Trigger `gfpdf_template_loaded` JS event after loading new PDF Template settings dynamically
|
119 |
+
* Dev Feature: Add `gfpdf_field_product_value` filter to change Product table HTML mark-up in PDF
|
120 |
+
|
121 |
+
* Bug: Enable Image Watermarks in PDF
|
122 |
+
* Bug: Prevent HTML fields getting passed through `wpautop()` [GH#834]
|
123 |
+
* Bug: Test for writability in the mPDF tmp directory and fallback to the Gravity PDF tmp directory if failed [GH#837]
|
124 |
+
* Bug: Fix scheduled licensing status check and display better error if license deactivation fails [GH#838]
|
125 |
+
* Bug: Correctly display the values for multiple Option fields assigned to a single Product when Product Table is ungrouped in PDF [GH#839]
|
126 |
+
* Bug: Disable IP-based authentication when the entry IP matches the server IP [GH#840]
|
127 |
+
|
128 |
+
= 5.0.2 =
|
129 |
+
* Bug: Resolve fatal error on WP Engine due to security in place that prevented mPDF font cache from being saved.
|
130 |
+
|
131 |
+
= 5.0.1 =
|
132 |
+
* Bug: Ensure the mPDF temporary directory is set to the PDF Working Directory `tmp` folder [GH#817]
|
133 |
+
* Bug: Refine the Background Processing description and tooltip text [GH#818]
|
134 |
+
|
135 |
+
= 5.0.0 =
|
136 |
+
* Breaking Change: Bump minimum version of Gravity Forms from 1.9 to 2.3.1+
|
137 |
+
* Breaking Change: Bump WordPress minimum version from 4.4 to 4.8+
|
138 |
+
* Breaking Change: Bump the PHP minimum version from 5.4 to 5.6+
|
139 |
+
* Breaking Change: Decouple the fonts from the plugin.
|
140 |
+
|
141 |
+
* Feature: Option to enable background Process PDFs during form submission and while resending notifications. Requires background tasks are enabled [GH#713]
|
142 |
+
* Feature: Include a Core Font Downloader in the PDF Tools to install all core PDF fonts during the initial installation [GH#709]
|
143 |
+
* Feature: Updated ReactJS to v16 which uses MIT license [GH#701]
|
144 |
+
* Feature: Add PHP7.2 Support [GH#716]
|
145 |
+
* Feature: Polyfill older browsers to support our modern Javascript [GH#729]
|
146 |
+
* Feature: Remove "Common Problems" link from PDF Help page and include "Common Questions" [GH#752]
|
147 |
+
|
148 |
+
* Dev: Update all Packagist-managed JS files to the latest version [GH#701]
|
149 |
+
* Dev: Upgrade Mpdf to version 7.1 (accessed directly via `\Mpdf\Mpdf`)
|
150 |
+
* Dev: Conditionally run `Model_PDF::maybe_save_pdf()` when Background Processing disabled [GH#713]
|
151 |
+
* Dev: Use wp_enqueue_editor() to load up the WP Editor assets [GH#754]
|
152 |
+
* Dev: Include file/line number when PDF error is thrown [GH#803]
|
153 |
+
* Dev: Remove the legacy /resources/ directory
|
154 |
+
|
155 |
+
* Bug: Fix Chosen Drop Down display issue when WordPress using RTL display [GH#698]
|
156 |
+
* Bug: Fix PHP Notice when Post Image field is blank [GH#805]
|
157 |
+
* Bug: Correct A5 Label so it correctly references 148 x 210mm [GH#811]
|
158 |
+
* Bug: Correct default en_US localization strings [GH#815] (credit Garrett Hyder)
|
159 |
+
|
160 |
+
See [CHANGELOG.txt](https://github.com/GravityPDF/gravity-pdf/blob/master/CHANGELOG.txt) for v4 and v3 changelog history.
|
161 |
+
|
162 |
+
== Upgrade Notice ==
|
163 |
+
|
164 |
+
= 5.0.0 =
|
165 |
+
WARNING: Breaking changes! New minimum versions: PHP5.6+, WordPress 4.8+, Gravity Forms 2.3.1+.
|
166 |
+
|
167 |
+
= 4.2.0 =
|
168 |
+
WARNING: The minimum WordPress version supported is now 4.4.
|
169 |
+
|
170 |
+
= 4.0.4 =
|
171 |
+
This patch fixes a PDF security by-passing issue. If you use the PDF Security settings update immediately.
|
172 |
+
|
173 |
+
= 4.0.3 =
|
174 |
+
The core PDF templates have been updated to version 1.1. If you've previously run the Custom Template Setup make sure you run it again to take advantage of the changes.
|
175 |
+
|
176 |
+
= 4.0 =
|
177 |
+
**WARNING**: This major release is not 100% backwards compatibile with v3. Review our upgrade guide AND do a full backup before proceeding with the update (https://goo.gl/htd6CK).
|
pdf.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Gravity PDF
|
4 |
-
Version: 5.1.
|
5 |
Description: Automatically generate highly-customisable PDF documents using Gravity Forms.
|
6 |
Author: Gravity PDF
|
7 |
Author URI: https://gravitypdf.com
|
@@ -37,7 +37,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
37 |
/*
|
38 |
* Set base constants we'll use throughout the plugin
|
39 |
*/
|
40 |
-
define( 'PDF_EXTENDED_VERSION', '5.1.
|
41 |
define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
|
42 |
define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
|
43 |
define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Gravity PDF
|
4 |
+
Version: 5.1.2
|
5 |
Description: Automatically generate highly-customisable PDF documents using Gravity Forms.
|
6 |
Author: Gravity PDF
|
7 |
Author URI: https://gravitypdf.com
|
37 |
/*
|
38 |
* Set base constants we'll use throughout the plugin
|
39 |
*/
|
40 |
+
define( 'PDF_EXTENDED_VERSION', '5.1.2' ); /* the current plugin version */
|
41 |
define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
|
42 |
define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
|
43 |
define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
|
src/assets/languages/gravity-forms-pdf-extended.pot
CHANGED
@@ -1049,7 +1049,7 @@ msgstr ""
|
|
1049 |
msgid "The PDF could not be saved."
|
1050 |
msgstr ""
|
1051 |
|
1052 |
-
#: src/model/Model_PDF.php:
|
1053 |
msgid "Could not find PDF configuration requested"
|
1054 |
msgstr ""
|
1055 |
|
@@ -1085,11 +1085,11 @@ msgstr ""
|
|
1085 |
msgid "A font with the same name already exists. Try a different name."
|
1086 |
msgstr ""
|
1087 |
|
1088 |
-
#: src/model/Model_Settings.php:
|
1089 |
msgid "License deactivated."
|
1090 |
msgstr ""
|
1091 |
|
1092 |
-
#: src/model/Model_Settings.php:
|
1093 |
msgid "An error occurred during deactivation, please try again"
|
1094 |
msgstr ""
|
1095 |
|
1049 |
msgid "The PDF could not be saved."
|
1050 |
msgstr ""
|
1051 |
|
1052 |
+
#: src/model/Model_PDF.php:1890
|
1053 |
msgid "Could not find PDF configuration requested"
|
1054 |
msgstr ""
|
1055 |
|
1085 |
msgid "A font with the same name already exists. Try a different name."
|
1086 |
msgstr ""
|
1087 |
|
1088 |
+
#: src/model/Model_Settings.php:880
|
1089 |
msgid "License deactivated."
|
1090 |
msgstr ""
|
1091 |
|
1092 |
+
#: src/model/Model_Settings.php:900
|
1093 |
msgid "An error occurred during deactivation, please try again"
|
1094 |
msgstr ""
|
1095 |
|
src/deprecated.php
CHANGED
@@ -798,6 +798,23 @@ if ( ! class_exists( 'mPDF' ) ) {
|
|
798 |
}
|
799 |
}
|
800 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
801 |
/**
|
802 |
* @param int $type
|
803 |
*
|
798 |
}
|
799 |
}
|
800 |
|
801 |
+
/**
|
802 |
+
* Allow the relaying of property calls to the new Mpdf class
|
803 |
+
*
|
804 |
+
* @param $name
|
805 |
+
*
|
806 |
+
* @return mixed
|
807 |
+
*
|
808 |
+
* @since 5.1.2
|
809 |
+
*/
|
810 |
+
public function __get( $name ) {
|
811 |
+
if ( property_exists( $this->mpdf, $name ) ) {
|
812 |
+
return $this->mpdf->{$name};
|
813 |
+
}
|
814 |
+
|
815 |
+
return null;
|
816 |
+
}
|
817 |
+
|
818 |
/**
|
819 |
* @param int $type
|
820 |
*
|
src/helper/Helper_Logger.php
CHANGED
@@ -205,7 +205,7 @@ class Helper_Logger {
|
|
205 |
if ( ! empty( $log_level ) && $log_level !== 6 ) {
|
206 |
|
207 |
/* Convert Gravity Forms log levels to the appropriate Monolog level */
|
208 |
-
$monolog_level = ( $log_level === 4 ) ? Logger::ERROR : Logger::
|
209 |
|
210 |
/* Setup our stream and change the format to more-suit Gravity Forms */
|
211 |
$formatter = new LineFormatter( "%datetime% - %level_name% --> %message% %context% %extra%\n" );
|
205 |
if ( ! empty( $log_level ) && $log_level !== 6 ) {
|
206 |
|
207 |
/* Convert Gravity Forms log levels to the appropriate Monolog level */
|
208 |
+
$monolog_level = ( $log_level === 4 ) ? Logger::ERROR : Logger::DEBUG;
|
209 |
|
210 |
/* Setup our stream and change the format to more-suit Gravity Forms */
|
211 |
$formatter = new LineFormatter( "%datetime% - %level_name% --> %message% %context% %extra%\n" );
|
src/model/Model_PDF.php
CHANGED
@@ -1013,7 +1013,10 @@ class Model_PDF extends Helper_Abstract_Model {
|
|
1013 |
$notifications['attachments'] = ( isset( $notifications['attachments'] ) ) ? $notifications['attachments'] : [];
|
1014 |
|
1015 |
/* Loop through each PDF config and generate */
|
1016 |
-
foreach ( $pdfs as $
|
|
|
|
|
|
|
1017 |
|
1018 |
/* Reset the variables each loop */
|
1019 |
$filename = $tier_2_filename = '';
|
1013 |
$notifications['attachments'] = ( isset( $notifications['attachments'] ) ) ? $notifications['attachments'] : [];
|
1014 |
|
1015 |
/* Loop through each PDF config and generate */
|
1016 |
+
foreach ( $pdfs as $pdf ) {
|
1017 |
+
|
1018 |
+
/* Pass it through the config filters */
|
1019 |
+
$settings = $this->options->get_pdf( $entry['form_id'], $pdf['id'] );
|
1020 |
|
1021 |
/* Reset the variables each loop */
|
1022 |
$filename = $tier_2_filename = '';
|
src/model/Model_Settings.php
CHANGED
@@ -671,6 +671,15 @@ class Model_Settings extends Helper_Abstract_Model {
|
|
671 |
if ( isset( $response['response']['code'] ) && $response['response']['code'] === 200 &&
|
672 |
isset( $response['body'] ) && $response['body'] === 'failed-if-read'
|
673 |
) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
$return = false;
|
675 |
}
|
676 |
}
|
671 |
if ( isset( $response['response']['code'] ) && $response['response']['code'] === 200 &&
|
672 |
isset( $response['body'] ) && $response['body'] === 'failed-if-read'
|
673 |
) {
|
674 |
+
$response_object = $response['http_response'];
|
675 |
+
$raw_response = $response_object->get_response_object();
|
676 |
+
$this->log->warning(
|
677 |
+
'PDF temporary directory not protected', [
|
678 |
+
'url' => $raw_response->url,
|
679 |
+
'status_code' => $raw_response->status_code,
|
680 |
+
'response' => $raw_response->raw,
|
681 |
+
] );
|
682 |
+
|
683 |
$return = false;
|
684 |
}
|
685 |
}
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -337,6 +337,7 @@ return array(
|
|
337 |
'Mpdf\\Gif\\ImageHeader' => $vendorDir . '/mpdf/mpdf/src/Gif/ImageHeader.php',
|
338 |
'Mpdf\\Gif\\Lzw' => $vendorDir . '/mpdf/mpdf/src/Gif/Lzw.php',
|
339 |
'Mpdf\\Gradient' => $vendorDir . '/mpdf/mpdf/src/Gradient.php',
|
|
|
340 |
'Mpdf\\Hyphenator' => $vendorDir . '/mpdf/mpdf/src/Hyphenator.php',
|
341 |
'Mpdf\\Image\\Bmp' => $vendorDir . '/mpdf/mpdf/src/Image/Bmp.php',
|
342 |
'Mpdf\\Image\\ImageProcessor' => $vendorDir . '/mpdf/mpdf/src/Image/ImageProcessor.php',
|
337 |
'Mpdf\\Gif\\ImageHeader' => $vendorDir . '/mpdf/mpdf/src/Gif/ImageHeader.php',
|
338 |
'Mpdf\\Gif\\Lzw' => $vendorDir . '/mpdf/mpdf/src/Gif/Lzw.php',
|
339 |
'Mpdf\\Gradient' => $vendorDir . '/mpdf/mpdf/src/Gradient.php',
|
340 |
+
'Mpdf\\HTMLParserMode' => $vendorDir . '/mpdf/mpdf/src/HTMLParserMode.php',
|
341 |
'Mpdf\\Hyphenator' => $vendorDir . '/mpdf/mpdf/src/Hyphenator.php',
|
342 |
'Mpdf\\Image\\Bmp' => $vendorDir . '/mpdf/mpdf/src/Image/Bmp.php',
|
343 |
'Mpdf\\Image\\ImageProcessor' => $vendorDir . '/mpdf/mpdf/src/Image/ImageProcessor.php',
|
vendor/composer/autoload_files.php
CHANGED
@@ -7,7 +7,7 @@ $baseDir = dirname($vendorDir);
|
|
7 |
|
8 |
return array(
|
9 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
10 |
-
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
11 |
'5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
|
|
|
12 |
'e9b046393eb3376a21bcc1a30bd2fe64' => $vendorDir . '/querypath/querypath/src/qp_functions.php',
|
13 |
);
|
7 |
|
8 |
return array(
|
9 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
|
|
10 |
'5255c38a0faeba867671b61dfda6d864' => $vendorDir . '/paragonie/random_compat/lib/random.php',
|
11 |
+
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
12 |
'e9b046393eb3376a21bcc1a30bd2fe64' => $vendorDir . '/querypath/querypath/src/qp_functions.php',
|
13 |
);
|
vendor/composer/autoload_static.php
CHANGED
@@ -8,8 +8,8 @@ class ComposerStaticInitGravityPDFPlugin
|
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
11 |
-
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
12 |
'5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
|
|
|
13 |
'e9b046393eb3376a21bcc1a30bd2fe64' => __DIR__ . '/..' . '/querypath/querypath/src/qp_functions.php',
|
14 |
);
|
15 |
|
@@ -482,6 +482,7 @@ class ComposerStaticInitGravityPDFPlugin
|
|
482 |
'Mpdf\\Gif\\ImageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/ImageHeader.php',
|
483 |
'Mpdf\\Gif\\Lzw' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Lzw.php',
|
484 |
'Mpdf\\Gradient' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gradient.php',
|
|
|
485 |
'Mpdf\\Hyphenator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Hyphenator.php',
|
486 |
'Mpdf\\Image\\Bmp' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Bmp.php',
|
487 |
'Mpdf\\Image\\ImageProcessor' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/ImageProcessor.php',
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
|
|
11 |
'5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
|
12 |
+
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
13 |
'e9b046393eb3376a21bcc1a30bd2fe64' => __DIR__ . '/..' . '/querypath/querypath/src/qp_functions.php',
|
14 |
);
|
15 |
|
482 |
'Mpdf\\Gif\\ImageHeader' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/ImageHeader.php',
|
483 |
'Mpdf\\Gif\\Lzw' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gif/Lzw.php',
|
484 |
'Mpdf\\Gradient' => __DIR__ . '/..' . '/mpdf/mpdf/src/Gradient.php',
|
485 |
+
'Mpdf\\HTMLParserMode' => __DIR__ . '/..' . '/mpdf/mpdf/src/HTMLParserMode.php',
|
486 |
'Mpdf\\Hyphenator' => __DIR__ . '/..' . '/mpdf/mpdf/src/Hyphenator.php',
|
487 |
'Mpdf\\Image\\Bmp' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/Bmp.php',
|
488 |
'Mpdf\\Image\\ImageProcessor' => __DIR__ . '/..' . '/mpdf/mpdf/src/Image/ImageProcessor.php',
|
vendor/composer/installed.json
CHANGED
@@ -37,7 +37,7 @@
|
|
37 |
{
|
38 |
"name": "Josh Lockhart",
|
39 |
"email": "info@joshlockhart.com",
|
40 |
-
"homepage": "
|
41 |
}
|
42 |
],
|
43 |
"description": "Handle file uploads with extensible validation and storage strategies",
|
@@ -256,17 +256,17 @@
|
|
256 |
},
|
257 |
{
|
258 |
"name": "mpdf/mpdf",
|
259 |
-
"version": "v7.1.
|
260 |
-
"version_normalized": "7.1.
|
261 |
"source": {
|
262 |
"type": "git",
|
263 |
"url": "https://github.com/mpdf/mpdf.git",
|
264 |
-
"reference": "
|
265 |
},
|
266 |
"dist": {
|
267 |
"type": "zip",
|
268 |
-
"url": "https://api.github.com/repos/mpdf/mpdf/zipball/
|
269 |
-
"reference": "
|
270 |
"shasum": ""
|
271 |
},
|
272 |
"require": {
|
@@ -274,7 +274,7 @@
|
|
274 |
"ext-mbstring": "*",
|
275 |
"myclabs/deep-copy": "^1.7",
|
276 |
"paragonie/random_compat": "^1.4|^2.0|9.99.99",
|
277 |
-
"php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0",
|
278 |
"psr/log": "^1.0",
|
279 |
"setasign/fpdi": "1.6.*"
|
280 |
},
|
@@ -289,7 +289,7 @@
|
|
289 |
"ext-xml": "Needed mainly for SVG manipulation",
|
290 |
"ext-zlib": "Needed for compression of embedded resources, such as fonts"
|
291 |
},
|
292 |
-
"time": "2018-
|
293 |
"type": "library",
|
294 |
"extra": {
|
295 |
"branch-alias": {
|
@@ -316,7 +316,7 @@
|
|
316 |
"role": "Developer (retired)"
|
317 |
}
|
318 |
],
|
319 |
-
"description": "
|
320 |
"homepage": "https://mpdf.github.io",
|
321 |
"keywords": [
|
322 |
"pdf",
|
37 |
{
|
38 |
"name": "Josh Lockhart",
|
39 |
"email": "info@joshlockhart.com",
|
40 |
+
"homepage": "http://www.joshlockhart.com/"
|
41 |
}
|
42 |
],
|
43 |
"description": "Handle file uploads with extensible validation and storage strategies",
|
256 |
},
|
257 |
{
|
258 |
"name": "mpdf/mpdf",
|
259 |
+
"version": "v7.1.7",
|
260 |
+
"version_normalized": "7.1.7.0",
|
261 |
"source": {
|
262 |
"type": "git",
|
263 |
"url": "https://github.com/mpdf/mpdf.git",
|
264 |
+
"reference": "ac60286a7dc5250c293afebd2bd9414e58a02466"
|
265 |
},
|
266 |
"dist": {
|
267 |
"type": "zip",
|
268 |
+
"url": "https://api.github.com/repos/mpdf/mpdf/zipball/ac60286a7dc5250c293afebd2bd9414e58a02466",
|
269 |
+
"reference": "ac60286a7dc5250c293afebd2bd9414e58a02466",
|
270 |
"shasum": ""
|
271 |
},
|
272 |
"require": {
|
274 |
"ext-mbstring": "*",
|
275 |
"myclabs/deep-copy": "^1.7",
|
276 |
"paragonie/random_compat": "^1.4|^2.0|9.99.99",
|
277 |
+
"php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0",
|
278 |
"psr/log": "^1.0",
|
279 |
"setasign/fpdi": "1.6.*"
|
280 |
},
|
289 |
"ext-xml": "Needed mainly for SVG manipulation",
|
290 |
"ext-zlib": "Needed for compression of embedded resources, such as fonts"
|
291 |
},
|
292 |
+
"time": "2018-11-29T18:21:32+00:00",
|
293 |
"type": "library",
|
294 |
"extra": {
|
295 |
"branch-alias": {
|
316 |
"role": "Developer (retired)"
|
317 |
}
|
318 |
],
|
319 |
+
"description": "PHP library generating PDF files from UTF-8 encoded HTML",
|
320 |
"homepage": "https://mpdf.github.io",
|
321 |
"keywords": [
|
322 |
"pdf",
|
vendor/mpdf/mpdf/.travis.yml
CHANGED
@@ -9,6 +9,7 @@ php:
|
|
9 |
- 7.0
|
10 |
- 7.1
|
11 |
- 7.2
|
|
|
12 |
- nightly
|
13 |
|
14 |
matrix:
|
@@ -25,7 +26,14 @@ matrix:
|
|
25 |
|
26 |
install:
|
27 |
- composer self-update
|
28 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
script:
|
31 |
- |
|
9 |
- 7.0
|
10 |
- 7.1
|
11 |
- 7.2
|
12 |
+
- 7.3
|
13 |
- nightly
|
14 |
|
15 |
matrix:
|
26 |
|
27 |
install:
|
28 |
- composer self-update
|
29 |
+
- |
|
30 |
+
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then
|
31 |
+
composer install --ignore-platform-reqs
|
32 |
+
elif [[ ${TRAVIS_PHP_VERSION:0:3} == "7.4" ]]; then
|
33 |
+
composer install --ignore-platform-reqs
|
34 |
+
else
|
35 |
+
composer install
|
36 |
+
fi
|
37 |
|
38 |
script:
|
39 |
- |
|
vendor/mpdf/mpdf/composer.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
"name": "mpdf/mpdf",
|
4 |
"type": "library",
|
5 |
|
6 |
-
"description": "
|
7 |
|
8 |
"keywords": ["php", "pdf", "utf-8"],
|
9 |
"homepage": "https://mpdf.github.io",
|
@@ -31,7 +31,7 @@
|
|
31 |
|
32 |
"require": {
|
33 |
|
34 |
-
"php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0",
|
35 |
|
36 |
"ext-gd": "*",
|
37 |
"ext-mbstring": "*",
|
3 |
"name": "mpdf/mpdf",
|
4 |
"type": "library",
|
5 |
|
6 |
+
"description": "PHP library generating PDF files from UTF-8 encoded HTML",
|
7 |
|
8 |
"keywords": ["php", "pdf", "utf-8"],
|
9 |
"homepage": "https://mpdf.github.io",
|
31 |
|
32 |
"require": {
|
33 |
|
34 |
+
"php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0",
|
35 |
|
36 |
"ext-gd": "*",
|
37 |
"ext-mbstring": "*",
|
vendor/mpdf/mpdf/src/Barcode.php
CHANGED
@@ -26,151 +26,117 @@ class Barcode
|
|
26 |
*/
|
27 |
public function getBarcode($code, $type, $pr = 0.0)
|
28 |
{
|
29 |
-
$barcode = false;
|
30 |
-
|
31 |
switch (strtoupper($type)) {
|
32 |
case 'ISBN':
|
33 |
case 'ISSN':
|
34 |
case 'EAN13': // EAN 13
|
35 |
-
|
36 |
-
break;
|
37 |
|
38 |
case 'UPCA': // UPC-A
|
39 |
-
|
40 |
-
break;
|
41 |
|
42 |
case 'UPCE': // UPC-E
|
43 |
-
|
44 |
-
break;
|
45 |
|
46 |
case 'EAN8': // EAN 8
|
47 |
-
|
48 |
-
break;
|
49 |
|
50 |
case 'EAN2': // 2-Digits UPC-Based Extention
|
51 |
-
|
52 |
-
break;
|
53 |
|
54 |
case 'EAN5': // 5-Digits UPC-Based Extention
|
55 |
-
|
56 |
-
break;
|
57 |
|
58 |
case 'IMB': // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
|
59 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
60 |
$bpi = 22; // Bars per inch
|
61 |
-
|
62 |
-
break;
|
63 |
|
64 |
case 'RM4SCC': // RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
|
65 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
66 |
$bpi = 22; // Bars per inch
|
67 |
-
|
68 |
-
break;
|
69 |
|
70 |
case 'KIX': // KIX (Klant index - Customer index)
|
71 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
72 |
$bpi = 22; // Bars per inch
|
73 |
-
|
74 |
-
break;
|
75 |
|
76 |
case 'POSTNET': // POSTNET
|
77 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
78 |
$bpi = 22; // Bars per inch
|
79 |
-
|
80 |
-
break;
|
81 |
|
82 |
case 'PLANET': // PLANET
|
83 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
84 |
$bpi = 22; // Bars per inch
|
85 |
-
|
86 |
-
break;
|
87 |
|
88 |
case 'C93': // CODE 93 - USS-93
|
89 |
-
|
90 |
-
break;
|
91 |
|
92 |
case 'CODE11': // CODE 11
|
93 |
-
|
94 |
-
break;
|
95 |
|
96 |
case 'MSI': // MSI (Variation of Plessey code)
|
97 |
-
|
98 |
-
break;
|
99 |
|
100 |
case 'MSI+': // MSI + CHECKSUM (modulo 11)
|
101 |
-
|
102 |
-
break;
|
103 |
|
104 |
case 'CODABAR': // CODABAR
|
105 |
-
|
106 |
-
break;
|
107 |
|
108 |
case 'C128A': // CODE 128 A
|
109 |
-
|
110 |
-
break;
|
111 |
|
112 |
case 'C128B': // CODE 128 B
|
113 |
-
|
114 |
-
break;
|
115 |
|
116 |
case 'C128C': // CODE 128 C
|
117 |
-
|
118 |
-
break;
|
119 |
|
120 |
case 'EAN128A': // EAN 128 A
|
121 |
-
|
122 |
-
break;
|
123 |
|
124 |
case 'EAN128B': // EAN 128 B
|
125 |
-
|
126 |
-
break;
|
127 |
|
128 |
case 'EAN128C': // EAN 128 C
|
129 |
-
|
130 |
-
break;
|
131 |
|
132 |
case 'C39': // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
|
133 |
-
|
134 |
-
break;
|
135 |
|
136 |
case 'C39+': // CODE 39 with checksum
|
137 |
-
|
138 |
-
break;
|
139 |
|
140 |
case 'C39E': // CODE 39 EXTENDED
|
141 |
-
|
142 |
-
break;
|
143 |
|
144 |
case 'C39E+': // CODE 39 EXTENDED + CHECKSUM
|
145 |
-
|
146 |
-
break;
|
147 |
|
148 |
case 'S25': // Standard 2 of 5
|
149 |
-
|
150 |
-
break;
|
151 |
|
152 |
case 'S25+': // Standard 2 of 5 + CHECKSUM
|
153 |
-
|
154 |
-
break;
|
155 |
|
156 |
case 'I25': // Interleaved 2 of 5
|
157 |
-
|
158 |
-
break;
|
159 |
|
160 |
case 'I25+': // Interleaved 2 of 5 + CHECKSUM
|
161 |
-
|
162 |
-
break;
|
163 |
|
164 |
case 'I25B': // Interleaved 2 of 5 + Bearer bars
|
165 |
-
|
166 |
-
break;
|
167 |
|
168 |
case 'I25B+': // Interleaved 2 of 5 + CHECKSUM + Bearer bars
|
169 |
-
|
170 |
-
break;
|
171 |
}
|
172 |
|
173 |
-
return
|
174 |
}
|
175 |
|
176 |
private function sanitizeCode($code)
|
26 |
*/
|
27 |
public function getBarcode($code, $type, $pr = 0.0)
|
28 |
{
|
|
|
|
|
29 |
switch (strtoupper($type)) {
|
30 |
case 'ISBN':
|
31 |
case 'ISSN':
|
32 |
case 'EAN13': // EAN 13
|
33 |
+
return new Barcode\EanUpc($code, 13, 11, 7, 0.33, 25.93);
|
|
|
34 |
|
35 |
case 'UPCA': // UPC-A
|
36 |
+
return new Barcode\EanUpc($code, 12, 9, 9, 0.33, 25.91);
|
|
|
37 |
|
38 |
case 'UPCE': // UPC-E
|
39 |
+
return new Barcode\EanUpc($code, 6, 9, 7, 0.33, 25.93);
|
|
|
40 |
|
41 |
case 'EAN8': // EAN 8
|
42 |
+
return new Barcode\EanUpc($code, 8, 7, 7, 0.33, 21.64);
|
|
|
43 |
|
44 |
case 'EAN2': // 2-Digits UPC-Based Extention
|
45 |
+
return new Barcode\EanExt($code, 2, 7, 7, 0.33, 20, 9);
|
|
|
46 |
|
47 |
case 'EAN5': // 5-Digits UPC-Based Extention
|
48 |
+
return new Barcode\EanExt($code, 5, 7, 7, 0.33, 20, 9);
|
|
|
49 |
|
50 |
case 'IMB': // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
|
51 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
52 |
$bpi = 22; // Bars per inch
|
53 |
+
return new Barcode\Imb($code, $xdim, ((25.4 / $bpi) - $xdim) / $xdim, ['D' => 2, 'A' => 2, 'F' => 3, 'T' => 1]);
|
|
|
54 |
|
55 |
case 'RM4SCC': // RM4SCC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
|
56 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
57 |
$bpi = 22; // Bars per inch
|
58 |
+
return new Barcode\Rm4Scc($code, $xdim, ((25.4 / $bpi) - $xdim) / $xdim, ['D' => 5, 'A' => 5, 'F' => 8, 'T' => 2]);
|
|
|
59 |
|
60 |
case 'KIX': // KIX (Klant index - Customer index)
|
61 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
62 |
$bpi = 22; // Bars per inch
|
63 |
+
return new Barcode\Rm4Scc($code, $xdim, ((25.4 / $bpi) - $xdim) / $xdim, ['D' => 5, 'A' => 5, 'F' => 8, 'T' => 2], true);
|
|
|
64 |
|
65 |
case 'POSTNET': // POSTNET
|
66 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
67 |
$bpi = 22; // Bars per inch
|
68 |
+
return new Barcode\Postnet($code, $xdim, ((25.4 / $bpi) - $xdim) / $xdim, false);
|
|
|
69 |
|
70 |
case 'PLANET': // PLANET
|
71 |
$xdim = 0.508; // Nominal value for X-dim (bar width) in mm (spec.)
|
72 |
$bpi = 22; // Bars per inch
|
73 |
+
return new Barcode\Postnet($code, $xdim, ((25.4 / $bpi) - $xdim) / $xdim, true);
|
|
|
74 |
|
75 |
case 'C93': // CODE 93 - USS-93
|
76 |
+
return new Barcode\Code93($code);
|
|
|
77 |
|
78 |
case 'CODE11': // CODE 11
|
79 |
+
return new Barcode\Code11($code, ($pr > 0) ? $pr : 3);
|
|
|
80 |
|
81 |
case 'MSI': // MSI (Variation of Plessey code)
|
82 |
+
return new Barcode\Msi($code, false);
|
|
|
83 |
|
84 |
case 'MSI+': // MSI + CHECKSUM (modulo 11)
|
85 |
+
return new Barcode\Msi($code, true);
|
|
|
86 |
|
87 |
case 'CODABAR': // CODABAR
|
88 |
+
return new Barcode\Codabar($code, ($pr > 0) ? $pr : 2.5);
|
|
|
89 |
|
90 |
case 'C128A': // CODE 128 A
|
91 |
+
return new Barcode\Code128($code, 'A');
|
|
|
92 |
|
93 |
case 'C128B': // CODE 128 B
|
94 |
+
return new Barcode\Code128($code, 'B');
|
|
|
95 |
|
96 |
case 'C128C': // CODE 128 C
|
97 |
+
return new Barcode\Code128($code, 'C');
|
|
|
98 |
|
99 |
case 'EAN128A': // EAN 128 A
|
100 |
+
return new Barcode\Code128($code, 'A', true);
|
|
|
101 |
|
102 |
case 'EAN128B': // EAN 128 B
|
103 |
+
return new Barcode\Code128($code, 'B', true);
|
|
|
104 |
|
105 |
case 'EAN128C': // EAN 128 C
|
106 |
+
return new Barcode\Code128($code, 'C', true);
|
|
|
107 |
|
108 |
case 'C39': // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
|
109 |
+
return new Barcode\Code39($this->sanitizeCode($code), ($pr > 0) ? $pr : 2.5, false, false);
|
|
|
110 |
|
111 |
case 'C39+': // CODE 39 with checksum
|
112 |
+
return new Barcode\Code39($this->sanitizeCode($code), ($pr > 0) ? $pr : 2.5, false, true);
|
|
|
113 |
|
114 |
case 'C39E': // CODE 39 EXTENDED
|
115 |
+
return new Barcode\Code39($this->sanitizeCode($code), ($pr > 0) ? $pr : 2.5, true, false);
|
|
|
116 |
|
117 |
case 'C39E+': // CODE 39 EXTENDED + CHECKSUM
|
118 |
+
return new Barcode\Code39($this->sanitizeCode($code), ($pr > 0) ? $pr : 2.5, true, true);
|
|
|
119 |
|
120 |
case 'S25': // Standard 2 of 5
|
121 |
+
return new Barcode\S25($code, false);
|
|
|
122 |
|
123 |
case 'S25+': // Standard 2 of 5 + CHECKSUM
|
124 |
+
return new Barcode\S25($code, true);
|
|
|
125 |
|
126 |
case 'I25': // Interleaved 2 of 5
|
127 |
+
return new Barcode\I25($code, 0, ($pr > 0) ? $pr : 2.5, false);
|
|
|
128 |
|
129 |
case 'I25+': // Interleaved 2 of 5 + CHECKSUM
|
130 |
+
return new Barcode\I25($code, 0, ($pr > 0) ? $pr : 2.5, true);
|
|
|
131 |
|
132 |
case 'I25B': // Interleaved 2 of 5 + Bearer bars
|
133 |
+
return new Barcode\I25($code, 2, ($pr > 0) ? $pr : 2.5, false);
|
|
|
134 |
|
135 |
case 'I25B+': // Interleaved 2 of 5 + CHECKSUM + Bearer bars
|
136 |
+
return new Barcode\I25($code, 2, ($pr > 0) ? $pr : 2.5, true);
|
|
|
137 |
}
|
138 |
|
139 |
+
return false;
|
140 |
}
|
141 |
|
142 |
private function sanitizeCode($code)
|
vendor/mpdf/mpdf/src/CssManager.php
CHANGED
@@ -2250,11 +2250,13 @@ class CssManager
|
|
2250 |
}
|
2251 |
|
2252 |
if ($this->mpdf->basepathIsLocal) {
|
|
|
2253 |
$tr = parse_url($path);
|
2254 |
-
$lp =
|
2255 |
$ap = realpath($lp);
|
2256 |
$ap = str_replace("\\", '/', $ap);
|
2257 |
$docroot = substr($ap, 0, strpos($ap, $lp));
|
|
|
2258 |
// WriteHTML parses all paths to full URLs; may be local file name
|
2259 |
// DOCUMENT_ROOT is not returned on IIS
|
2260 |
if (!empty($tr['scheme']) && $tr['host'] && !empty($_SERVER['DOCUMENT_ROOT'])) {
|
@@ -2264,13 +2266,17 @@ class CssManager
|
|
2264 |
} else {
|
2265 |
$localpath = $path;
|
2266 |
}
|
|
|
2267 |
$contents = @file_get_contents($localpath);
|
|
|
2268 |
} elseif (!$contents && !ini_get('allow_url_fopen') && function_exists('curl_init')) { // if not use full URL
|
|
|
2269 |
$ch = curl_init($path);
|
2270 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
2271 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
2272 |
$contents = curl_exec($ch);
|
2273 |
curl_close($ch);
|
|
|
2274 |
}
|
2275 |
|
2276 |
return $contents;
|
2250 |
}
|
2251 |
|
2252 |
if ($this->mpdf->basepathIsLocal) {
|
2253 |
+
|
2254 |
$tr = parse_url($path);
|
2255 |
+
$lp = __FILE__;
|
2256 |
$ap = realpath($lp);
|
2257 |
$ap = str_replace("\\", '/', $ap);
|
2258 |
$docroot = substr($ap, 0, strpos($ap, $lp));
|
2259 |
+
|
2260 |
// WriteHTML parses all paths to full URLs; may be local file name
|
2261 |
// DOCUMENT_ROOT is not returned on IIS
|
2262 |
if (!empty($tr['scheme']) && $tr['host'] && !empty($_SERVER['DOCUMENT_ROOT'])) {
|
2266 |
} else {
|
2267 |
$localpath = $path;
|
2268 |
}
|
2269 |
+
|
2270 |
$contents = @file_get_contents($localpath);
|
2271 |
+
|
2272 |
} elseif (!$contents && !ini_get('allow_url_fopen') && function_exists('curl_init')) { // if not use full URL
|
2273 |
+
|
2274 |
$ch = curl_init($path);
|
2275 |
curl_setopt($ch, CURLOPT_HEADER, 0);
|
2276 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
2277 |
$contents = curl_exec($ch);
|
2278 |
curl_close($ch);
|
2279 |
+
|
2280 |
}
|
2281 |
|
2282 |
return $contents;
|
vendor/mpdf/mpdf/src/Form.php
CHANGED
@@ -618,12 +618,16 @@ class Form
|
|
618 |
$radius = $this->mpdf->FontSize * 0.35;
|
619 |
$cx = $x + ($w / 2);
|
620 |
$cy = $y + ($h / 2);
|
|
|
|
|
|
|
|
|
621 |
if (!empty($objattr['disabled'])) {
|
622 |
$this->mpdf->SetFColor($this->colorConverter->convert(127, $this->mpdf->PDFAXwarnings));
|
623 |
$this->mpdf->SetDColor($this->colorConverter->convert(127, $this->mpdf->PDFAXwarnings));
|
624 |
} else {
|
625 |
-
$this->mpdf->SetFColor($
|
626 |
-
$this->mpdf->SetDColor($
|
627 |
}
|
628 |
$this->mpdf->Circle($cx, $cy, $radius, 'D');
|
629 |
if (!empty($objattr['checked'])) {
|
618 |
$radius = $this->mpdf->FontSize * 0.35;
|
619 |
$cx = $x + ($w / 2);
|
620 |
$cy = $y + ($h / 2);
|
621 |
+
$color = $this->colorConverter->convert(0, $this->mpdf->PDFAXwarnings);
|
622 |
+
if (isset($objattr['color']) && $objattr['color']) {
|
623 |
+
$color = $objattr['color'];
|
624 |
+
}
|
625 |
if (!empty($objattr['disabled'])) {
|
626 |
$this->mpdf->SetFColor($this->colorConverter->convert(127, $this->mpdf->PDFAXwarnings));
|
627 |
$this->mpdf->SetDColor($this->colorConverter->convert(127, $this->mpdf->PDFAXwarnings));
|
628 |
} else {
|
629 |
+
$this->mpdf->SetFColor($color);
|
630 |
+
$this->mpdf->SetDColor($color);
|
631 |
}
|
632 |
$this->mpdf->Circle($cx, $cy, $radius, 'D');
|
633 |
if (!empty($objattr['checked'])) {
|
vendor/mpdf/mpdf/src/HTMLParserMode.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Mpdf;
|
4 |
+
|
5 |
+
class HTMLParserMode
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Parses a whole $html document
|
9 |
+
*/
|
10 |
+
const DEFAULT_MODE = 0;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Parses the $html as styles and stylesheets only
|
14 |
+
*/
|
15 |
+
const HEADER_CSS = 1;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Parses the $html as output elements only
|
19 |
+
*/
|
20 |
+
const HTML_BODY = 2;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* (For internal use only - parses the $html code without writing to document)
|
24 |
+
*
|
25 |
+
* @internal
|
26 |
+
*/
|
27 |
+
const HTML_PARSE_NO_WRITE = 3;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* (For internal use only - writes the $html code to a buffer)
|
31 |
+
*
|
32 |
+
* @internal
|
33 |
+
*/
|
34 |
+
const HTML_HEADER_BUFFER = 4;
|
35 |
+
|
36 |
+
public static function getAllModes()
|
37 |
+
{
|
38 |
+
return [
|
39 |
+
self::DEFAULT_MODE,
|
40 |
+
self::HEADER_CSS,
|
41 |
+
self::HTML_BODY,
|
42 |
+
self::HTML_PARSE_NO_WRITE,
|
43 |
+
self::HTML_HEADER_BUFFER,
|
44 |
+
];
|
45 |
+
}
|
46 |
+
}
|
vendor/mpdf/mpdf/src/Mpdf.php
CHANGED
@@ -43,7 +43,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
43 |
|
44 |
use Strict;
|
45 |
|
46 |
-
const VERSION = '7.1.
|
47 |
|
48 |
const SCALE = 72 / 25.4;
|
49 |
|
@@ -9550,7 +9550,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
9550 |
$this->pageBackgrounds = [];
|
9551 |
|
9552 |
$this->writingHTMLheader = true;
|
9553 |
-
$this->WriteHTML($html,
|
9554 |
$this->writingHTMLheader = false;
|
9555 |
$this->Reset();
|
9556 |
$this->pageoutput[$n] = [];
|
@@ -9633,7 +9633,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
9633 |
|
9634 |
$this->writingHTMLfooter = true;
|
9635 |
$this->InFooter = true;
|
9636 |
-
$this->WriteHTML($html,
|
9637 |
$this->InFooter = false;
|
9638 |
$this->Reset();
|
9639 |
$this->pageoutput[$n] = [];
|
@@ -12247,7 +12247,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
12247 |
$this->HTMLheaderPageForms = [];
|
12248 |
$savepb = $this->pageBackgrounds;
|
12249 |
$this->writingHTMLheader = true;
|
12250 |
-
$this->WriteHTML($html,
|
12251 |
$this->writingHTMLheader = false;
|
12252 |
$h = ($this->y - $this->margin_header);
|
12253 |
$this->Reset();
|
@@ -12944,18 +12944,16 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
12944 |
/* -- HTML-CSS -- */
|
12945 |
|
12946 |
/**
|
12947 |
-
* HTML
|
|
|
|
|
12948 |
*
|
12949 |
* @param string $html
|
12950 |
-
* @param int $
|
12951 |
-
*
|
12952 |
-
*
|
12953 |
-
* 3 = HTML parses only
|
12954 |
-
* 4 = writes HTML headers/Fixed pos DIVs - stores in buffer - for single page only
|
12955 |
-
* @param bool $init Clears and sets buffers to Top level block etc.
|
12956 |
-
* @param bool $close If false leaves buffers etc. in current state, so that it can continue a block etc.
|
12957 |
*/
|
12958 |
-
function WriteHTML($html, $
|
12959 |
{
|
12960 |
/* Check $html is an integer, float, string, boolean or class with __toString(), otherwise throw exception */
|
12961 |
if (is_scalar($html) === false) {
|
@@ -12964,6 +12962,17 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
12964 |
}
|
12965 |
}
|
12966 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12967 |
/* Cast $html as a string */
|
12968 |
$html = (string) $html;
|
12969 |
|
@@ -12974,15 +12983,15 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
12974 |
$this->textbuffer = [];
|
12975 |
$this->fixedPosBlockSave = [];
|
12976 |
}
|
12977 |
-
if ($
|
12978 |
$html = '<style> ' . $html . ' </style>';
|
12979 |
} // stylesheet only
|
12980 |
|
12981 |
if ($this->allow_charset_conversion) {
|
12982 |
-
if ($
|
12983 |
$this->ReadCharset($html);
|
12984 |
}
|
12985 |
-
if ($this->charset_in && $
|
12986 |
$success = iconv($this->charset_in, 'UTF-8//TRANSLIT', $html);
|
12987 |
if ($success) {
|
12988 |
$html = $success;
|
@@ -13002,7 +13011,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
13002 |
}
|
13003 |
|
13004 |
$zproperties = [];
|
13005 |
-
if ($
|
13006 |
$this->ReadMetaTags($html);
|
13007 |
|
13008 |
if (preg_match('/<base[^>]*href=["\']([^"\'>]*)["\']/i', $html, $m)) {
|
@@ -13054,7 +13063,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
13054 |
|
13055 |
$this->blk[0]['InlineProperties'] = $this->saveInlineProperties();
|
13056 |
|
13057 |
-
if ($
|
13058 |
return '';
|
13059 |
}
|
13060 |
if (!isset($this->cssManager->CSS['BODY'])) {
|
@@ -13100,7 +13109,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
13100 |
|
13101 |
$parseonly = false;
|
13102 |
$this->bufferoutput = false;
|
13103 |
-
if ($
|
13104 |
$parseonly = true;
|
13105 |
// Close any open block tags
|
13106 |
$arr = [];
|
@@ -13113,7 +13122,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
13113 |
$this->printbuffer($this->textbuffer);
|
13114 |
}
|
13115 |
$this->textbuffer = [];
|
13116 |
-
} elseif ($
|
13117 |
// Close any open block tags
|
13118 |
$arr = [];
|
13119 |
$ai = 0;
|
@@ -13157,7 +13166,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
13157 |
$html = preg_replace('/<htmlpageheader.*?<\/htmlpageheader>/si', '', $html);
|
13158 |
$html = preg_replace('/<htmlpagefooter.*?<\/htmlpagefooter>/si', '', $html);
|
13159 |
|
13160 |
-
if ($this->state == 0 && $
|
13161 |
$this->AddPage($this->CurOrientation);
|
13162 |
}
|
13163 |
|
@@ -14191,7 +14200,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
14191 |
$this->pageBackgrounds = [];
|
14192 |
$this->maxPosR = 0;
|
14193 |
$this->maxPosL = $this->w; // For RTL
|
14194 |
-
$this->WriteHTML($html,
|
14195 |
$inner_w = $this->maxPosR - $this->lMargin;
|
14196 |
if ($bbox_right_auto) {
|
14197 |
$bbox_right = $cont_w - $bbox_left - $bbox_ml - $bbox_bl - $bbox_pl - $inner_w - $bbox_pr - $bbox_br - $bbox_ml;
|
@@ -14221,7 +14230,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
14221 |
$this->HTMLheaderPageAnnots = [];
|
14222 |
$this->HTMLheaderPageForms = [];
|
14223 |
$this->pageBackgrounds = [];
|
14224 |
-
$this->WriteHTML($html,
|
14225 |
$inner_h = $this->y - $y;
|
14226 |
|
14227 |
if ($overflow != 'hidden' && $overflow != 'visible') { // constrained
|
@@ -14280,7 +14289,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
14280 |
|
14281 |
$this->pageBackgrounds = [];
|
14282 |
|
14283 |
-
$this->WriteHTML($html,
|
14284 |
|
14285 |
$actual_h = $this->y - $y;
|
14286 |
$use_w = $w;
|
@@ -14289,41 +14298,43 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
14289 |
|
14290 |
if ($overflow != 'hidden' && $overflow != 'visible') {
|
14291 |
$target = $h / $w;
|
14292 |
-
if (
|
14293 |
-
|
14294 |
-
|
14295 |
-
|
14296 |
-
|
14297 |
-
|
14298 |
-
|
14299 |
-
|
|
|
14300 |
|
14301 |
-
|
14302 |
-
|
14303 |
|
14304 |
-
|
14305 |
-
|
14306 |
|
14307 |
-
|
14308 |
-
|
14309 |
-
|
14310 |
-
|
14311 |
-
|
14312 |
-
|
14313 |
-
|
14314 |
-
|
14315 |
-
|
14316 |
|
14317 |
-
|
14318 |
-
|
14319 |
-
|
14320 |
-
|
14321 |
-
|
14322 |
-
|
14323 |
-
|
14324 |
-
|
14325 |
-
|
14326 |
-
|
|
|
14327 |
}
|
14328 |
}
|
14329 |
|
@@ -16442,11 +16453,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
16442 |
}
|
16443 |
}
|
16444 |
|
16445 |
-
|
16446 |
-
$continuingpage = true;
|
16447 |
-
} else {
|
16448 |
-
$continuingpage = false;
|
16449 |
-
}
|
16450 |
|
16451 |
if (isset($this->blk[$blvl]['y0'])) {
|
16452 |
$y0 = $this->blk[$blvl]['y0'];
|
@@ -17536,6 +17543,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
17536 |
$y0 = $this->y; // top
|
17537 |
$x1 = $this->x + $w; // bottom
|
17538 |
$y1 = $this->y + $h; // bottom
|
|
|
17539 |
|
17540 |
if ($this->blk[$blvl]['border_top'] && ($state == 1 || $state == 3)) {
|
17541 |
$tbd = $this->blk[$blvl]['border_top'];
|
@@ -21162,7 +21170,7 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
21162 |
$celladj = false;
|
21163 |
}
|
21164 |
|
21165 |
-
if ($celladj && $celladj['border_details']['T']['s'] == 1) {
|
21166 |
|
21167 |
$csadj = $celladj['border_details']['T']['w'];
|
21168 |
$csthis = $cbord['border_details']['B']['w'];
|
@@ -25532,6 +25540,9 @@ class Mpdf implements \Psr\Log\LoggerAwareInterface
|
|
25532 |
$prevFontSizePt = $this->FontSizePt;
|
25533 |
$this->SetFont($bsf, '', '', false);
|
25534 |
$this->SetFont($prevFontFamily, $prevFontStyle, $prevFontSizePt, false);
|
|
|
|
|
|
|
25535 |
}
|
25536 |
|
25537 |
if (!$cw) {
|
43 |
|
44 |
use Strict;
|
45 |
|
46 |
+
const VERSION = '7.1.7';
|
47 |
|
48 |
const SCALE = 72 / 25.4;
|
49 |
|
9550 |
$this->pageBackgrounds = [];
|
9551 |
|
9552 |
$this->writingHTMLheader = true;
|
9553 |
+
$this->WriteHTML($html, HTMLParserMode::HTML_HEADER_BUFFER);
|
9554 |
$this->writingHTMLheader = false;
|
9555 |
$this->Reset();
|
9556 |
$this->pageoutput[$n] = [];
|
9633 |
|
9634 |
$this->writingHTMLfooter = true;
|
9635 |
$this->InFooter = true;
|
9636 |
+
$this->WriteHTML($html, HTMLParserMode::HTML_HEADER_BUFFER);
|
9637 |
$this->InFooter = false;
|
9638 |
$this->Reset();
|
9639 |
$this->pageoutput[$n] = [];
|
12247 |
$this->HTMLheaderPageForms = [];
|
12248 |
$savepb = $this->pageBackgrounds;
|
12249 |
$this->writingHTMLheader = true;
|
12250 |
+
$this->WriteHTML($html, HTMLParserMode::HTML_HEADER_BUFFER);
|
12251 |
$this->writingHTMLheader = false;
|
12252 |
$h = ($this->y - $this->margin_header);
|
12253 |
$this->Reset();
|
12944 |
/* -- HTML-CSS -- */
|
12945 |
|
12946 |
/**
|
12947 |
+
* Write HTML code to the document
|
12948 |
+
*
|
12949 |
+
* Also used internally to parse HTML into buffers
|
12950 |
*
|
12951 |
* @param string $html
|
12952 |
+
* @param int $mode Use HTMLParserMode constants. Controls what parts of the $html code is parsed.
|
12953 |
+
* @param bool $init Clears and sets buffers to Top level block etc.
|
12954 |
+
* @param bool $close If false leaves buffers etc. in current state, so that it can continue a block etc.
|
|
|
|
|
|
|
|
|
12955 |
*/
|
12956 |
+
function WriteHTML($html, $mode = HTMLParserMode::DEFAULT_MODE, $init = true, $close = true)
|
12957 |
{
|
12958 |
/* Check $html is an integer, float, string, boolean or class with __toString(), otherwise throw exception */
|
12959 |
if (is_scalar($html) === false) {
|
12962 |
}
|
12963 |
}
|
12964 |
|
12965 |
+
// Check the mode is valid
|
12966 |
+
if (in_array($mode, HTMLParserMode::getAllModes(), true) === false) {
|
12967 |
+
// We only throw an exception if it's in debug
|
12968 |
+
if ($this->debug === true) {
|
12969 |
+
throw new \Mpdf\MpdfException('WriteHTML() requires $mode to be one of the modes defined in HTMLParserMode');
|
12970 |
+
}
|
12971 |
+
|
12972 |
+
// If it's not an accepted mode, set it to the default mode
|
12973 |
+
$mode = HTMLParserMode::DEFAULT_MODE;
|
12974 |
+
}
|
12975 |
+
|
12976 |
/* Cast $html as a string */
|
12977 |
$html = (string) $html;
|
12978 |
|
12983 |
$this->textbuffer = [];
|
12984 |
$this->fixedPosBlockSave = [];
|
12985 |
}
|
12986 |
+
if ($mode === HTMLParserMode::HEADER_CSS) {
|
12987 |
$html = '<style> ' . $html . ' </style>';
|
12988 |
} // stylesheet only
|
12989 |
|
12990 |
if ($this->allow_charset_conversion) {
|
12991 |
+
if ($mode === HTMLParserMode::DEFAULT_MODE) {
|
12992 |
$this->ReadCharset($html);
|
12993 |
}
|
12994 |
+
if ($this->charset_in && $mode !== HTMLParserMode::HTML_HEADER_BUFFER) {
|
12995 |
$success = iconv($this->charset_in, 'UTF-8//TRANSLIT', $html);
|
12996 |
if ($success) {
|
12997 |
$html = $success;
|
13011 |
}
|
13012 |
|
13013 |
$zproperties = [];
|
13014 |
+
if ($mode === HTMLParserMode::DEFAULT_MODE || $mode === HTMLParserMode::HEADER_CSS) {
|
13015 |
$this->ReadMetaTags($html);
|
13016 |
|
13017 |
if (preg_match('/<base[^>]*href=["\']([^"\'>]*)["\']/i', $html, $m)) {
|
13063 |
|
13064 |
$this->blk[0]['InlineProperties'] = $this->saveInlineProperties();
|
13065 |
|
13066 |
+
if ($mode === HTMLParserMode::HEADER_CSS) {
|
13067 |
return '';
|
13068 |
}
|
13069 |
if (!isset($this->cssManager->CSS['BODY'])) {
|
13109 |
|
13110 |
$parseonly = false;
|
13111 |
$this->bufferoutput = false;
|
13112 |
+
if ($mode == HTMLParserMode::HTML_PARSE_NO_WRITE) {
|
13113 |
$parseonly = true;
|
13114 |
// Close any open block tags
|
13115 |
$arr = [];
|
13122 |
$this->printbuffer($this->textbuffer);
|
13123 |
}
|
13124 |
$this->textbuffer = [];
|
13125 |
+
} elseif ($mode === HTMLParserMode::HTML_HEADER_BUFFER) {
|
13126 |
// Close any open block tags
|
13127 |
$arr = [];
|
13128 |
$ai = 0;
|
13166 |
$html = preg_replace('/<htmlpageheader.*?<\/htmlpageheader>/si', '', $html);
|
13167 |
$html = preg_replace('/<htmlpagefooter.*?<\/htmlpagefooter>/si', '', $html);
|
13168 |
|
13169 |
+
if ($this->state == 0 && ($mode === HTMLParserMode::DEFAULT_MODE || $mode === HTMLParserMode::HTML_BODY)) {
|
13170 |
$this->AddPage($this->CurOrientation);
|
13171 |
}
|
13172 |
|
14200 |
$this->pageBackgrounds = [];
|
14201 |
$this->maxPosR = 0;
|
14202 |
$this->maxPosL = $this->w; // For RTL
|
14203 |
+
$this->WriteHTML($html, HTMLParserMode::HTML_HEADER_BUFFER);
|
14204 |
$inner_w = $this->maxPosR - $this->lMargin;
|
14205 |
if ($bbox_right_auto) {
|
14206 |
$bbox_right = $cont_w - $bbox_left - $bbox_ml - $bbox_bl - $bbox_pl - $inner_w - $bbox_pr - $bbox_br - $bbox_ml;
|
14230 |
$this->HTMLheaderPageAnnots = [];
|
14231 |
$this->HTMLheaderPageForms = [];
|
14232 |
$this->pageBackgrounds = [];
|
14233 |
+
$this->WriteHTML($html, HTMLParserMode::HTML_HEADER_BUFFER);
|
14234 |
$inner_h = $this->y - $y;
|
14235 |
|
14236 |
if ($overflow != 'hidden' && $overflow != 'visible') { // constrained
|
14289 |
|
14290 |
$this->pageBackgrounds = [];
|
14291 |
|
14292 |
+
$this->WriteHTML($html, HTMLParserMode::HTML_HEADER_BUFFER);
|
14293 |
|
14294 |
$actual_h = $this->y - $y;
|
14295 |
$use_w = $w;
|
14298 |
|
14299 |
if ($overflow != 'hidden' && $overflow != 'visible') {
|
14300 |
$target = $h / $w;
|
14301 |
+
if ($target > 0) {
|
14302 |
+
if (($ratio / $target) > 1) {
|
14303 |
+
$nl = ceil($actual_h / $this->lineheight);
|
14304 |
+
$l = $use_w * $nl;
|
14305 |
+
$est_w = sqrt(($l * $this->lineheight) / $target) * 0.8;
|
14306 |
+
$use_w += ($est_w - $use_w) - ($w / 100);
|
14307 |
+
}
|
14308 |
+
$bpcstart = ($ratio / $target);
|
14309 |
+
$bpcctr = 1;
|
14310 |
|
14311 |
+
while (($ratio / $target) > 1) {
|
14312 |
+
// @log 'Auto-sizing fixed-position block $bpcctr++
|
14313 |
|
14314 |
+
$this->x = $x;
|
14315 |
+
$this->y = $y;
|
14316 |
|
14317 |
+
if (($ratio / $target) > 1.5 || ($ratio / $target) < 0.6) {
|
14318 |
+
$use_w += ($w / $this->incrementFPR1);
|
14319 |
+
} elseif (($ratio / $target) > 1.2 || ($ratio / $target) < 0.85) {
|
14320 |
+
$use_w += ($w / $this->incrementFPR2);
|
14321 |
+
} elseif (($ratio / $target) > 1.1 || ($ratio / $target) < 0.91) {
|
14322 |
+
$use_w += ($w / $this->incrementFPR3);
|
14323 |
+
} else {
|
14324 |
+
$use_w += ($w / $this->incrementFPR4);
|
14325 |
+
}
|
14326 |
|
14327 |
+
$use_h = $use_w * $target;
|
14328 |
+
$this->rMargin = $this->w - $use_w - $x;
|
14329 |
+
$this->pgwidth = $this->w - $this->lMargin - $this->rMargin;
|
14330 |
+
$this->HTMLheaderPageLinks = [];
|
14331 |
+
$this->HTMLheaderPageAnnots = [];
|
14332 |
+
$this->HTMLheaderPageForms = [];
|
14333 |
+
$this->pageBackgrounds = [];
|
14334 |
+
$this->WriteHTML($html, HTMLParserMode::HTML_HEADER_BUFFER);
|
14335 |
+
$actual_h = $this->y - $y;
|
14336 |
+
$ratio = $actual_h / $use_w;
|
14337 |
+
}
|
14338 |
}
|
14339 |
}
|
14340 |
|
16453 |
}
|
16454 |
}
|
16455 |
|
16456 |
+
$continuingpage = (isset($this->blk[$blvl]['startpage']) && $this->blk[$blvl]['startpage'] != $this->page);
|
|
|
|
|
|
|
|
|
16457 |
|
16458 |
if (isset($this->blk[$blvl]['y0'])) {
|
16459 |
$y0 = $this->blk[$blvl]['y0'];
|
17543 |
$y0 = $this->y; // top
|
17544 |
$x1 = $this->x + $w; // bottom
|
17545 |
$y1 = $this->y + $h; // bottom
|
17546 |
+
$continuingpage = (isset($this->blk[$blvl]['startpage']) && $this->blk[$blvl]['startpage'] != $this->page);
|
17547 |
|
17548 |
if ($this->blk[$blvl]['border_top'] && ($state == 1 || $state == 3)) {
|
17549 |
$tbd = $this->blk[$blvl]['border_top'];
|
21170 |
$celladj = false;
|
21171 |
}
|
21172 |
|
21173 |
+
if (isset($celladj['border_details']['T']['s']) && $celladj['border_details']['T']['s'] == 1) {
|
21174 |
|
21175 |
$csadj = $celladj['border_details']['T']['w'];
|
21176 |
$csthis = $cbord['border_details']['B']['w'];
|
25540 |
$prevFontSizePt = $this->FontSizePt;
|
25541 |
$this->SetFont($bsf, '', '', false);
|
25542 |
$this->SetFont($prevFontFamily, $prevFontStyle, $prevFontSizePt, false);
|
25543 |
+
if ($this->fontCache->has($font . '.cw.dat')) {
|
25544 |
+
$cw = $this->fontCache->load($font . '.cw.dat');
|
25545 |
+
}
|
25546 |
}
|
25547 |
|
25548 |
if (!$cw) {
|
vendor/mpdf/mpdf/src/Otl.php
CHANGED
@@ -5384,7 +5384,7 @@ class Otl
|
|
5384 |
$nc2++;
|
5385 |
$i2 = 0;
|
5386 |
}
|
5387 |
-
if ($para[$nc2][18]['char_data'][$i2]['diid'] != $ir) {
|
5388 |
continue;
|
5389 |
}
|
5390 |
$nexttype = $para[$nc2][18]['char_data'][$i2]['type'];
|
@@ -5570,7 +5570,7 @@ class Otl
|
|
5570 |
$numchunks = count($content);
|
5571 |
$maxlevel = 0;
|
5572 |
for ($nc = 0; $nc < $numchunks; $nc++) {
|
5573 |
-
$numchars = count($cOTLdata[$nc]['char_data']);
|
5574 |
for ($i = 0; $i < $numchars; ++$i) {
|
5575 |
$carac = [];
|
5576 |
if (isset($cOTLdata[$nc]['GPOSinfo'][$i])) {
|
5384 |
$nc2++;
|
5385 |
$i2 = 0;
|
5386 |
}
|
5387 |
+
if (!isset($para[$nc2][18]['char_data'][$i2]['diid']) || $para[$nc2][18]['char_data'][$i2]['diid'] != $ir) {
|
5388 |
continue;
|
5389 |
}
|
5390 |
$nexttype = $para[$nc2][18]['char_data'][$i2]['type'];
|
5570 |
$numchunks = count($content);
|
5571 |
$maxlevel = 0;
|
5572 |
for ($nc = 0; $nc < $numchunks; $nc++) {
|
5573 |
+
$numchars = isset($cOTLdata[$nc]['char_data']) ? count($cOTLdata[$nc]['char_data']) : 0;
|
5574 |
for ($i = 0; $i < $numchars; ++$i) {
|
5575 |
$carac = [];
|
5576 |
if (isset($cOTLdata[$nc]['GPOSinfo'][$i])) {
|
vendor/mpdf/mpdf/src/Writer/BackgroundWriter.php
CHANGED
@@ -146,9 +146,9 @@ final class BackgroundWriter
|
|
146 |
$this->writer->write('>>');
|
147 |
}
|
148 |
/* -- BACKGROUNDS -- */
|
149 |
-
if (isset($this->gradients) && ( count($this->mpdf->gradients) > 0)) {
|
150 |
$this->writer->write('/Shading <<');
|
151 |
-
foreach ($this->gradients as $id => $grad) {
|
152 |
if (isset($grad['fo']) && $grad['fo']) {
|
153 |
$this->writer->write('/Sh' . $id . ' ' . $grad['id'] . ' 0 R');
|
154 |
}
|
146 |
$this->writer->write('>>');
|
147 |
}
|
148 |
/* -- BACKGROUNDS -- */
|
149 |
+
if (isset($this->mpdf->gradients) && ( count($this->mpdf->gradients) > 0)) {
|
150 |
$this->writer->write('/Shading <<');
|
151 |
+
foreach ($this->mpdf->gradients as $id => $grad) {
|
152 |
if (isset($grad['fo']) && $grad['fo']) {
|
153 |
$this->writer->write('/Sh' . $id . ' ' . $grad['id'] . ' 0 R');
|
154 |
}
|