Skip to content

Commit

Permalink
Update tc-lib-pdf-encrypt and encode /DA.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Aug 30, 2024
1 parent a6b60f9 commit fed6d94
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.78
8.0.79
2 changes: 1 addition & 1 deletion resources/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Vcs-Git: https://github.com/~#VENDOR#~/~#PROJECT#~.git
Package: ~#PKGNAME#~
Provides: php-~#PROJECT#~
Architecture: all
Depends: php (>= 8.0.0), php-date, php-tecnickcom-tc-lib-barcode (<< 3.0.0), php-tecnickcom-tc-lib-barcode (>= 2.2.3), php-tecnickcom-tc-lib-color (<< 3.0.0), php-tecnickcom-tc-lib-color (>= 2.2.2), php-tecnickcom-tc-lib-pdf-image (<< 3.0.0), php-tecnickcom-tc-lib-pdf-image (>= 2.1.1), php-tecnickcom-tc-lib-pdf-font (<< 3.0.0), php-tecnickcom-tc-lib-pdf-font (>= 2.5.0), php-tecnickcom-tc-lib-file (<< 3.0.0), php-tecnickcom-tc-lib-file (>= 2.0.13), php-tecnickcom-tc-lib-pdf-encrypt (<< 3.0.0), php-tecnickcom-tc-lib-pdf-encrypt (>= 2.1.4), php-tecnickcom-tc-lib-unicode-data (<< 3.0.0), php-tecnickcom-tc-lib-unicode-data (>= 2.0.13), php-tecnickcom-tc-lib-unicode (<< 3.0.0), php-tecnickcom-tc-lib-unicode (>= 2.0.13), php-tecnickcom-tc-lib-pdf-page (<< 5.0.0), php-tecnickcom-tc-lib-pdf-page (>= 4.2.0), php-tecnickcom-tc-lib-pdf-graph (<< 3.0.0), php-tecnickcom-tc-lib-pdf-graph (>= 2.2.0), ${misc:Depends}
Depends: php (>= 8.0.0), php-date, php-tecnickcom-tc-lib-barcode (<< 3.0.0), php-tecnickcom-tc-lib-barcode (>= 2.2.3), php-tecnickcom-tc-lib-color (<< 3.0.0), php-tecnickcom-tc-lib-color (>= 2.2.2), php-tecnickcom-tc-lib-pdf-image (<< 3.0.0), php-tecnickcom-tc-lib-pdf-image (>= 2.1.1), php-tecnickcom-tc-lib-pdf-font (<< 3.0.0), php-tecnickcom-tc-lib-pdf-font (>= 2.5.0), php-tecnickcom-tc-lib-file (<< 3.0.0), php-tecnickcom-tc-lib-file (>= 2.0.13), php-tecnickcom-tc-lib-pdf-encrypt (<< 3.0.0), php-tecnickcom-tc-lib-pdf-encrypt (>= 2.1.5), php-tecnickcom-tc-lib-unicode-data (<< 3.0.0), php-tecnickcom-tc-lib-unicode-data (>= 2.0.13), php-tecnickcom-tc-lib-unicode (<< 3.0.0), php-tecnickcom-tc-lib-unicode (>= 2.0.13), php-tecnickcom-tc-lib-pdf-page (<< 5.0.0), php-tecnickcom-tc-lib-pdf-page (>= 4.2.0), php-tecnickcom-tc-lib-pdf-graph (<< 3.0.0), php-tecnickcom-tc-lib-pdf-graph (>= 2.2.0), ${misc:Depends}
Description: PHP Barcode library
This library includes PHP classes to generate PDF documents.
2 changes: 1 addition & 1 deletion resources/rpm/rpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Requires: php-composer(%{c_vendor}/tc-lib-pdf-font) >= 2.5.0
Requires: php-composer(%{c_vendor}/tc-lib-file) < 3.0.0
Requires: php-composer(%{c_vendor}/tc-lib-file) >= 2.0.13
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) < 3.0.0
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) >= 2.1.4
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) >= 2.1.5
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) < 3.0.0
Requires: php-composer(%{c_vendor}/tc-lib-unicode-data) >= 2.0.13
Requires: php-composer(%{c_vendor}/tc-lib-unicode) < 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ abstract class Base
/**
* TCPDF version.
*/
protected string $version = '8.0.78';
protected string $version = '8.0.79';

/**
* Time is seconds since EPOCH when the document was created.
Expand Down
11 changes: 6 additions & 5 deletions src/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ protected function getOutCatalog(): string
}

$font = $this->font->getFont('helvetica');
$out .= ' /DA (/F' . $font['i'] . ' 0 Tf 0 g)';
$out .= ' /DA ' . $this->encrypt->escapeDataString('/F' . $font['i'] . ' 0 Tf 0 g', $oid);
$out .= ' /Q ' . (($this->rtl) ? '2' : '0');
//$out .= ' /XFA ';
$out .= ' >>';
Expand Down Expand Up @@ -1657,7 +1657,7 @@ protected function getOutAnnotationOptSubtype(array $annot, int $pagenum, int $o
'caret' => $this->getOutAnnotationOptSubtypeCaret($annot),
'circle' => $this->getOutAnnotationOptSubtypeCircle($annot),
'fileattachment' => $this->getOutAnnotationOptSubtypeFileattachment($annot, $key),
'freetext' => $this->getOutAnnotationOptSubtypeFreetext($annot),
'freetext' => $this->getOutAnnotationOptSubtypeFreetext($annot, $oid),
'highlight' => $this->getOutAnnotationOptSubtypeHighlight($annot),
'ink' => $this->getOutAnnotationOptSubtypeInk($annot),
'line' => $this->getOutAnnotationOptSubtypeLine($annot),
Expand Down Expand Up @@ -1827,12 +1827,13 @@ protected function getOutAnnotationOptSubtypeLink(
* Returns the output code associated with the annotation opt.subtype.freetext.
*
* @param TAnnot $annot Array containing page annotations.
* @param int $oid Annotation Object ID.
*/
protected function getOutAnnotationOptSubtypeFreetext(array $annot): string
protected function getOutAnnotationOptSubtypeFreetext(array $annot, int $oid): string
{
$out = '';
if (! empty($annot['opt']['da'])) {
$out .= ' /DA (' . $annot['opt']['da'] . ')';
$out .= ' /DA ' . $this->encrypt->escapeDataString($annot['opt']['da'], $oid);
}

if (
Expand Down Expand Up @@ -2304,7 +2305,7 @@ protected function getOutAnnotationOptSubtypeWidget(
}

if (! empty($annot['opt']['da'])) {
$out .= ' /DA (' . $annot['opt']['da'] . ')';
$out .= ' /DA ' . $this->encrypt->escapeDataString($annot['opt']['da'], $oid);
}

if (
Expand Down

0 comments on commit fed6d94

Please sign in to comment.