Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for PDFreactor 11 #89

Merged
merged 22 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
__DIR__ . '/tests/_output',
__DIR__ . '/tests/Support/_generated',
])

->notPath([
'Processor/Api/PDFreactor.class.php'
])
;

// do not enable self_accessor as it breaks pimcore models relying on get_called_class()
Expand Down
10 changes: 5 additions & 5 deletions doc/01_Doc_Types_and_Available_Processors.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ This bundle introduces 2 new document types:

## Available PDF Processors

| Name | Description |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Chromium](https://www.chromium.org/Home/) | Convert to PDF by installing the Chromium binary or by using a dockerized chromium (via websocket) |
| [Gotenberg](https://gotenberg.dev/) | A Docker service with Chromium and LibreOffice support |
| [PDF Reactor](https://www.pdfreactor.com/) | A REST/SOAP solution, please visit the official website for further information |
| Name | Description |
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Chromium](https://www.chromium.org/Home/) | Convert to PDF by installing the Chromium binary or by using a dockerized chromium (via websocket) |
| [Gotenberg](https://gotenberg.dev/) | A Docker service with Chromium and LibreOffice support |
| [PDF Reactor](https://www.pdfreactor.com/) | A REST solution for rendering complex catalogs, please visit the official website for further information. Currently Pimcore supports PDFreactor 10, 11, 12 |

> For details on how to install and configure these processors, please see [Additional Tools Installation](https://pimcore.com/docs/platform/Pimcore/Installation_and_Upgrade/System_Setup_and_Hosting/Additional_Tools_Installation) page in the Core.

Expand Down
8 changes: 6 additions & 2 deletions src/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ public function testWeb2printAction(Request $request): Response

if ($adapter instanceof PdfReactor) {
$params['adapterConfig'] = [
'javaScriptMode' => 0,
'javaScriptSettings' => [
'enabled' => false,
],
'addLinks' => true,
'appendLog' => true,
'enableDebugMode' => true,
'debugSettings' => [
'all' => true,
],
];
} elseif ($adapter instanceof Gotenberg) {
$params = Config::getWeb2PrintConfig();
Expand Down
10 changes: 5 additions & 5 deletions src/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ public static function getInstance(): PdfReactor|Gotenberg|Chromium|Processor
{
$config = Config::getWeb2PrintConfig();

if($config['generalTool'] == 'pdfreactor') {
if ($config['generalTool'] == 'pdfreactor') {
return new PdfReactor();
} elseif($config['generalTool'] == 'chromium') {
} elseif ($config['generalTool'] == 'chromium') {
return new Chromium();
} elseif($config['generalTool'] == 'gotenberg') {
} elseif ($config['generalTool'] == 'gotenberg') {
return new Gotenberg();
} else {
if(class_exists($config['generalTool'])) {
if (class_exists($config['generalTool'])) {
$generalToolClass = new $config['generalTool']();
if($generalToolClass instanceof Processor) {
if ($generalToolClass instanceof Processor) {
return $generalToolClass;
}
}
Expand Down
Loading
Loading