Skip to content

Commit

Permalink
Merge pull request #3806 from nextcloud/feat/pdf-template-workflow-up…
Browse files Browse the repository at this point in the history
…date

feat: implement PdfService using mikehaertl/php-pdftk
  • Loading branch information
juliusknorr authored Aug 26, 2024
2 parents 1bb93a2 + 55cbed3 commit fed8437
Show file tree
Hide file tree
Showing 36 changed files with 4,275 additions and 19 deletions.
2 changes: 1 addition & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
['name' => 'Target#getPreview', 'url' => '/api/v1/targets/preview', 'verb' => 'GET'],

['name' => 'TemplateField#extractFields', 'url' => '/api/v1/template/fields/extract/{fileId}', 'verb' => 'GET'],
['name' => 'TemplateField#fillFields', 'url' => '/api/v1/template/fields/fill', 'verb' => 'POST'],
['name' => 'TemplateField#fillFields', 'url' => '/api/v1/template/fields/fill/{fileId}', 'verb' => 'POST'],
],
];
3 changes: 3 additions & 0 deletions composer/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"psr-4": {
"OCA\\Richdocuments\\": "../lib/"
}
},
"require": {
"mikehaertl/php-pdftk": "^0.13.1"
}
}
146 changes: 143 additions & 3 deletions composer/composer.lock

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

10 changes: 10 additions & 0 deletions composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
'OCA\\Richdocuments\\Service\\FileTargetService' => $baseDir . '/../lib/Service/FileTargetService.php',
'OCA\\Richdocuments\\Service\\FontService' => $baseDir . '/../lib/Service/FontService.php',
'OCA\\Richdocuments\\Service\\InitialStateService' => $baseDir . '/../lib/Service/InitialStateService.php',
'OCA\\Richdocuments\\Service\\PdfService' => $baseDir . '/../lib/Service/PdfService.php',
'OCA\\Richdocuments\\Service\\RemoteOptionsService' => $baseDir . '/../lib/Service/RemoteOptionsService.php',
'OCA\\Richdocuments\\Service\\RemoteService' => $baseDir . '/../lib/Service/RemoteService.php',
'OCA\\Richdocuments\\Service\\TemplateFieldService' => $baseDir . '/../lib/Service/TemplateFieldService.php',
Expand All @@ -89,4 +90,13 @@
'OCA\\Richdocuments\\TokenManager' => $baseDir . '/../lib/TokenManager.php',
'OCA\\Richdocuments\\UploadException' => $baseDir . '/../lib/UploadException.php',
'OCA\\Richdocuments\\WOPI\\Parser' => $baseDir . '/../lib/WOPI/Parser.php',
'mikehaertl\\pdftk\\Command' => $vendorDir . '/mikehaertl/php-pdftk/src/Command.php',
'mikehaertl\\pdftk\\DataFields' => $vendorDir . '/mikehaertl/php-pdftk/src/DataFields.php',
'mikehaertl\\pdftk\\FdfFile' => $vendorDir . '/mikehaertl/php-pdftk/src/FdfFile.php',
'mikehaertl\\pdftk\\InfoFields' => $vendorDir . '/mikehaertl/php-pdftk/src/InfoFields.php',
'mikehaertl\\pdftk\\InfoFile' => $vendorDir . '/mikehaertl/php-pdftk/src/InfoFile.php',
'mikehaertl\\pdftk\\Pdf' => $vendorDir . '/mikehaertl/php-pdftk/src/Pdf.php',
'mikehaertl\\pdftk\\XfdfFile' => $vendorDir . '/mikehaertl/php-pdftk/src/XfdfFile.php',
'mikehaertl\\shellcommand\\Command' => $vendorDir . '/mikehaertl/php-shellcommand/src/Command.php',
'mikehaertl\\tmp\\File' => $vendorDir . '/mikehaertl/php-tmpfile/src/File.php',
);
3 changes: 3 additions & 0 deletions composer/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
$baseDir = $vendorDir;

return array(
'mikehaertl\\tmp\\' => array($vendorDir . '/mikehaertl/php-tmpfile/src'),
'mikehaertl\\shellcommand\\' => array($vendorDir . '/mikehaertl/php-shellcommand/src'),
'mikehaertl\\pdftk\\' => array($vendorDir . '/mikehaertl/php-pdftk/src'),
'OCA\\Richdocuments\\' => array($baseDir . '/../lib'),
);
2 changes: 2 additions & 0 deletions composer/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public static function getLoader()
return self::$loader;
}

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInitRichdocuments', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitRichdocuments', 'loadClassLoader'));
Expand Down
28 changes: 28 additions & 0 deletions composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,31 @@
class ComposerStaticInitRichdocuments
{
public static $prefixLengthsPsr4 = array (
'm' =>
array (
'mikehaertl\\tmp\\' => 15,
'mikehaertl\\shellcommand\\' => 24,
'mikehaertl\\pdftk\\' => 17,
),
'O' =>
array (
'OCA\\Richdocuments\\' => 18,
),
);

public static $prefixDirsPsr4 = array (
'mikehaertl\\tmp\\' =>
array (
0 => __DIR__ . '/..' . '/mikehaertl/php-tmpfile/src',
),
'mikehaertl\\shellcommand\\' =>
array (
0 => __DIR__ . '/..' . '/mikehaertl/php-shellcommand/src',
),
'mikehaertl\\pdftk\\' =>
array (
0 => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src',
),
'OCA\\Richdocuments\\' =>
array (
0 => __DIR__ . '/..' . '/../lib',
Expand Down Expand Up @@ -92,6 +110,7 @@ class ComposerStaticInitRichdocuments
'OCA\\Richdocuments\\Service\\FileTargetService' => __DIR__ . '/..' . '/../lib/Service/FileTargetService.php',
'OCA\\Richdocuments\\Service\\FontService' => __DIR__ . '/..' . '/../lib/Service/FontService.php',
'OCA\\Richdocuments\\Service\\InitialStateService' => __DIR__ . '/..' . '/../lib/Service/InitialStateService.php',
'OCA\\Richdocuments\\Service\\PdfService' => __DIR__ . '/..' . '/../lib/Service/PdfService.php',
'OCA\\Richdocuments\\Service\\RemoteOptionsService' => __DIR__ . '/..' . '/../lib/Service/RemoteOptionsService.php',
'OCA\\Richdocuments\\Service\\RemoteService' => __DIR__ . '/..' . '/../lib/Service/RemoteService.php',
'OCA\\Richdocuments\\Service\\TemplateFieldService' => __DIR__ . '/..' . '/../lib/Service/TemplateFieldService.php',
Expand All @@ -104,6 +123,15 @@ class ComposerStaticInitRichdocuments
'OCA\\Richdocuments\\TokenManager' => __DIR__ . '/..' . '/../lib/TokenManager.php',
'OCA\\Richdocuments\\UploadException' => __DIR__ . '/..' . '/../lib/UploadException.php',
'OCA\\Richdocuments\\WOPI\\Parser' => __DIR__ . '/..' . '/../lib/WOPI/Parser.php',
'mikehaertl\\pdftk\\Command' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/Command.php',
'mikehaertl\\pdftk\\DataFields' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/DataFields.php',
'mikehaertl\\pdftk\\FdfFile' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/FdfFile.php',
'mikehaertl\\pdftk\\InfoFields' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/InfoFields.php',
'mikehaertl\\pdftk\\InfoFile' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/InfoFile.php',
'mikehaertl\\pdftk\\Pdf' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/Pdf.php',
'mikehaertl\\pdftk\\XfdfFile' => __DIR__ . '/..' . '/mikehaertl/php-pdftk/src/XfdfFile.php',
'mikehaertl\\shellcommand\\Command' => __DIR__ . '/..' . '/mikehaertl/php-shellcommand/src/Command.php',
'mikehaertl\\tmp\\File' => __DIR__ . '/..' . '/mikehaertl/php-tmpfile/src/File.php',
);

public static function getInitializer(ClassLoader $loader)
Expand Down
Loading

0 comments on commit fed8437

Please sign in to comment.