* Update tcpdf.php
Since the version 6.7.4, the "0" is considered like empty string and not displayed
* Update tcpdf.php
Co-authored-by: William Desportes <williamdes@wdes.fr>
* Fixed handling of transparency in PDF/A mode in addExtGState method
The condition allowed to add ExtGState in all PDF/A modes and disallowed
in default mode.
This fix inlines the condition with setExtGState to allow transparency
parameters for non-PDF/A and PDF/A > 1 documents.
The state condition is copied from 'setExtGState'.
* Encrypt /DA string when document is encrypted
When document is encrypted then /DA string must be encrypted,
without this Acrobat cannot allow fill form fields.
* Improve quality of generated seed, avoid potential security pitfall
* Try to use random_bytes() first if it's available
* Do not include the server parameters in the generated seed, as
they might contain sensitive data
As all current usages of getRandomSeed() directly hash the seed,
there should be no BC breaking changes.
The main source of entropy is more than enough on its own if
random_bytes() or openssl_random_pseudo_bytes() are available.
* Fix bug on _getannotsrefs when there are empty signature appearances but not other annot on a page
* Fix SVG coordinate parser that caused drawing artifacts
* Remove usage of xml_set_object() function
The xml_set_object() function will be deprecated in PHP 8.4 as well as
passing non-callable strings to the xml_set_*_handler() functions.
Instead of using xml_set_object(), the string method names in
xml_set_element_handler() and xml_set_character_data_handler() should be
replaced with callables.
- https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
---------
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Co-authored-by: jlouche <61839660+jlouche@users.noreply.github.com>
Co-authored-by: William Desportes <williamdes@wdes.fr>
Co-authored-by: stollr <christian.stoller@mail.de>
Co-authored-by: Robert Jędrzejczyk <robert@prog.olsztyn.pl>
Co-authored-by: Andreas Erhard <andreas.erhard@i-med.ac.at>
Co-authored-by: Alejandro Precioso <aprecioso@bigtree.com.ar>
Co-authored-by: davidrod <david@gassiotllobet.com>
Co-authored-by: sslldavid <119080321+sslldavid@users.noreply.github.com>
Co-authored-by: Alejandro <aprecioso@gmail.com>
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
PHP Deprecated: Implicit conversion from float 31.5 to int loses precision in /var/www/html/vendor/tecnickcom/tcpdf/include/barcodes/qrcode.php on line 891
PHP Deprecated: Implicit conversion from float 3.5 to int loses precision in /var/www/html/vendor/tecnickcom/tcpdf/include/barcodes/qrcode.php on line 895
Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
* Fix for PHP 8.1
If $style is empty, PHP is throwing a warning.You need to set the default as empty string if $style is not set.
* Apply suggestions from code review
Co-authored-by: William Desportes <williamdes@wdes.fr>
The updated places that used `AcceptPageBreak` assumed that a page break was added and increased X by the margin. However, if the break wasn't added, it would put the text further to the right to the point that the width because so small or negative and no characters fit, causing an infinite loop.
Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
* GetCssBorderStyle Has Problem When !important Is Specified
This is, in particular, a problem for PhpSpreadsheet. See https://github.com/PHPOffice/PhpSpreadsheet/issues/1164. TCPDF thinks that there can be 0, 1, 2, or 3 components to shorthand border style, but there can be more, e.g. !important. Logic is rearranged to allow for more than 3. A new example file is added to demonstrate that the fix works correctly.
* Improved Example
Better code coverage.
Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>