Skip to content

Commit

Permalink
Replace TCPDI by TCPDF
Browse files Browse the repository at this point in the history
TCPDI have problems when manipulate the original PDF file. The approach
to add footer at PDF files was replaced by create an overlay to each
page and merge with original PDF file.

Signed-off-by: Vitor Mattos <vitor@php.rio>
  • Loading branch information
vitormattos committed Mar 27, 2024
1 parent b496de1 commit 0144c9d
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 232 deletions.
11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
"license": "AGPL",
"require": {
"endroid/qr-code": "^4.6",
"iio/libmergepdf": "dev-move-tcpdi-parser-to-package",
"jsignpdf/jsignpdf-php": "^1.2",
"mikehaertl/php-pdftk": "^0.13.0",
"pagerfanta/pagerfanta": "^3.6",
"smalot/pdfparser": "^2.4",
"symfony/console": "^5.4",
"tecnickcom/tcpdf": "^6.4",
"tecnickcom/tcpdf": "^6.7",
"wobeto/email-blur": "^1.0"
},
"require-dev": {
Expand Down Expand Up @@ -62,11 +61,5 @@
"psr-4": {
"OCP\\": "vendor/nextcloud/ocp/OCP"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/LibreCodeCoop/libmergepdf"
}
]
}
}
181 changes: 5 additions & 176 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions lib/Db/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
namespace OCA\Libresign\Db;

use OCP\AppFramework\Db\Entity;
use stdClass;

/**
* @method void setId(int $id)
Expand All @@ -45,8 +46,7 @@
* @method string getCallback()
* @method void setStatus(int $status)
* @method int getStatus()
* @method void setPages(int $pages)
* @method int getPages()
* @method string getMetadata()
*/
class File extends Entity {
/** @var integer */
Expand Down Expand Up @@ -97,4 +97,16 @@ public function __construct() {
$this->addType('status', 'integer');
$this->addType('metadata', 'string');
}

public function setMetadata($metadata): void {
if (is_array($metadata)) {
$metadata = json_encode($metadata);
}
$this->metadata = (string) $metadata;
$this->markFieldUpdated('metadata');
}

public function getMetadataDecoded(): ?stdClass {
return json_decode($this->metadata);
}
}
3 changes: 0 additions & 3 deletions lib/Db/SignRequestMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ public function incrementNotificationCounter(SignRequest $signRequest, string $m
try {
$fromDatabase = $this->getById($signRequest->getId());
$metadata = $fromDatabase->getMetadata();
if (!empty($metadata)) {
$metadata = json_decode($metadata, true);
}
if (!isset($metadata['notify'])) {
$this->firstNotification = true;
}
Expand Down
Loading

0 comments on commit 0144c9d

Please sign in to comment.