Export do PDF pro projekt s PHP 8.1

Allconius
Člen | 308
+
0
-

Ahoj,

potřebuji si upravit projekt v nette pro PHP 8.1 kde ale používám generování výstupu z formuláře do PDF pomocí joseki/pdf-response. Čím bych to mohl nahradit? Co jsem našel tak všechno využívá mpdf a composer skončí na tom že mpdf nepodporuje PHP 8.1:

joseki/pdf-response

composer require joseki/pdf-response
Using version ^6.1 for joseki/pdf-response
./composer.json has been updated
Running composer update joseki/pdf-response
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mpdf/mpdf[v8.0.0, ..., v8.0.3] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.4, ..., v8.0.7] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.8, ..., v8.0.9] require php ^5.6 || ^7.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.10, ..., v8.0.12] require php ^5.6 || ^7.0 || ~8.0.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.13, ..., v8.1.2] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
    - joseki/pdf-response v6.1.0 requires mpdf/mpdf ^8.0 -> satisfiable by mpdf/mpdf[v8.0.0, ..., v8.1.2].
    - Root composer.json requires joseki/pdf-response ^6.1 -> satisfiable by joseki/pdf-response[v6.1.0].

To enable extensions, verify that they are enabled in your .ini files:
    - D:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require joseki/pdf-response:*" to figure out if any version is installable, or "composer require joseki/pdf-response:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

dotblue/nette-pdf

composer require dotblue/nette-pdf
Using version ^3.2 for dotblue/nette-pdf
./composer.json has been updated
Running composer update dotblue/nette-pdf
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mpdf/mpdf[v7.0.0, ..., v7.1.6] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v7.1.7, ..., v7.1.9, v8.0.0, ..., v8.0.3] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.4, ..., v8.0.7] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.8, ..., v8.0.9] require php ^5.6 || ^7.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.10, ..., v8.0.12] require php ^5.6 || ^7.0 || ~8.0.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.13, ..., v8.1.2] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
    - dotblue/nette-pdf 3.2.0 requires mpdf/mpdf ~7.0 || ~8.0 -> satisfiable by mpdf/mpdf[v7.0.0, ..., v7.1.9, v8.0.0, ..., v8.1.2].
    - Root composer.json requires dotblue/nette-pdf ^3.2 -> satisfiable by dotblue/nette-pdf[3.2.0].

To enable extensions, verify that they are enabled in your .ini files:
    - D:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require dotblue/nette-pdf:*" to figure out if any version is installable, or "composer require dotblue/nette-pdf:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

contributte/pdf

require contributte/pdf
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^6.1 for contributte/pdf
./composer.json has been updated
Running composer update contributte/pdf
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mpdf/mpdf[v8.0.0, ..., v8.0.3] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.4, ..., v8.0.7] require php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.8, ..., v8.0.9] require php ^5.6 || ^7.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.10, ..., v8.0.12] require php ^5.6 || ^7.0 || ~8.0.0 -> your php version (8.1.10) does not satisfy that requirement.
    - mpdf/mpdf[v8.0.13, ..., v8.1.2] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
    - contributte/pdf v6.1.0 requires mpdf/mpdf ^8.0 -> satisfiable by mpdf/mpdf[v8.0.0, ..., v8.1.2].
    - Root composer.json requires contributte/pdf ^6.1 -> satisfiable by contributte/pdf[v6.1.0].

To enable extensions, verify that they are enabled in your .ini files:
    - D:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.You can also try re-running composer require with an explicit version constraint, e.g. "composer require contributte/pdf:*" to figure out if any version is installable, or "composer require contributte/pdf:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Pavel Kravčík
Člen | 1175
+
+3
-

Používáme v PHP8.1 bez problémů. Hned první zmínka v dokumentaci.

mpdf/mpdf[v8.0.13, ..., v8.1.2] require ext-gd * -> it is missing from your system.

Editoval Pavel Kravčík (30. 11. 2022 14:18)

Allconius
Člen | 308
+
0
-

Pavel Kravčík napsal(a):

Používáme v PHP8.1 bez problémů. Hned první zmínka v dokumentaci.

mpdf/mpdf[v8.0.13, ..., v8.1.2] require ext-gd * -> it is missing from your system.

Ahoj, děkuji máš pravdu, chybělo mi to GD, použiju to contributte/pdf:

composer require joseki/pdf-response
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^6.1 for joseki/pdf-response
./composer.json has been updated
Running composer update joseki/pdf-response
Loading composer repositories with package information
Updating dependencies
Lock file operations: 8 installs, 0 updates, 0 removals
  - Locking joseki/pdf-response (v6.1.0)
  - Locking mpdf/mpdf (v8.1.2)
  - Locking myclabs/deep-copy (1.11.0)
  - Locking paragonie/random_compat (v9.99.100)
  - Locking php-http/message-factory (v1.0.2)
  - Locking psr/http-message (1.0.1)
  - Locking psr/log (2.0.0)
  - Locking setasign/fpdi (v2.3.6)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 8 installs, 0 updates, 0 removals
  - Downloading setasign/fpdi (v2.3.6)
  - Downloading psr/log (2.0.0)
  - Downloading psr/http-message (1.0.1)
  - Downloading php-http/message-factory (v1.0.2)
  - Downloading paragonie/random_compat (v9.99.100)
  - Downloading myclabs/deep-copy (1.11.0)
  - Downloading mpdf/mpdf (v8.1.2)
  - Downloading joseki/pdf-response (v6.1.0)
  - Installing setasign/fpdi (v2.3.6): Extracting archive
  - Installing psr/log (2.0.0): Extracting archive
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing php-http/message-factory (v1.0.2): Extracting archive
  - Installing paragonie/random_compat (v9.99.100): Extracting archive
  - Installing myclabs/deep-copy (1.11.0): Extracting archive
  - Installing mpdf/mpdf (v8.1.2): Extracting archive
  - Installing joseki/pdf-response (v6.1.0): Extracting archive
3 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package joseki/pdf-response is abandoned, you should avoid using it. Use contributte/pdf instead.
Package nette/tokenizer is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
21 packages you are using are looking for funding.
Use the `composer fund` command to find out more!