Coder Social home page Coder Social logo

PHP 8.2 not working about pdfmerger HOT 6 OPEN

myokyawhtun avatar myokyawhtun commented on July 19, 2024 1
PHP 8.2 not working

from pdfmerger.

Comments (6)

RigidCollision avatar RigidCollision commented on July 19, 2024

Got the following email communication from Epic2022:

The deprecated functions mentioned in the warnings are related to the TCPDF library, which is used for generating PDF files.
The library has functions with optional parameters that are declared before the required parameters, which is not a good practice.
You should update your code to use the latest version of TCPDF or update the deprecated function calls. If you can't update the library or code, you can suppress the warnings by modifying your php.ini file or adding the following line of code to the top of your PHP file:
error_reporting(E_ALL ^ E_DEPRECATED);
This will turn off the deprecation warnings for the code that you are running. However, this is not recommended as the code may become unusable in future versions of PHP.
It's always a good practice to update your code and libraries to their latest versions to avoid such issues.

I will be taking a look at this and when I have a solution will be posting.

from pdfmerger.

a4992214 avatar a4992214 commented on July 19, 2024

I am also stuck waiting on this issue

from pdfmerger.

aydos-t avatar aydos-t commented on July 19, 2024

for ex.
$unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); //don't work
Here you have to change the place of the variables:
$unicode = self::UTF8StringToArray($str, $currentfont, $isunicode); //workable way
or the variable $currentfont should write first:
$unicode = self::UTF8StringToArray($currentfont, $str, $isunicode); //workable way

from pdfmerger.

johnloydlao avatar johnloydlao commented on July 19, 2024

same problem.. anyone solved this issue ?

from pdfmerger.

johnloydlao avatar johnloydlao commented on July 19, 2024

same problem.. anyone solved this issue ?

https://github.com/sinanbekar/pdf-merger
this works for me

from pdfmerger.

RigidCollision avatar RigidCollision commented on July 19, 2024

In the end what I have done is get the latest FPDI and FPDF libraries and just re-work the original PHPMerger library to use them. Literally two lines need modifying that are specific to TCPDF (you remove the two lines specifically calling the TCPDF header and footer initialisation).

It works with PHPv8.3.3 and if you buy the official FPDI-Parser will handle pretty much everything. Even without the additional commercial parser it is as robust as the original.

This is pretty much what @johnloydlao has mentioned in the link above. When I drilled into what it was doing the code is really simple.

I am using:
FPDF v1.86
FPDI v2.6.0
FPDI-Parser v2.1.2 (not required but for (€100 probably worth it for robustness in a commercial environment).

There looks to be a new version of TCPDF under development which will handle some of the major changes brought about by PHPv8+. Information can be found here (https://tcpdf.org/ )but the link to the new version is: https://github.com/tecnickcom/tc-lib-pdf
A new TCPDF will remove the need for the additional FPDI-Parser (I believe) for dealing with PDF's version 1.4 and above.

from pdfmerger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.