dompdf and PHP 8 errors

If you are encountering similar errors while saving your PDF configuration or while submitting your form:

  • 0 round(): Argument #1 ($num) must be of type int|float, string given
  • Unsupported operand types: string + float
  • file_get_contents(): "Passing null to parameter #2 ($use_include_path) of type bool is deprecated 8192

...then you're most likely using the 'dompdf v0.8.3' version of PDF Library which is obsolete (dompdf8 is being included within the RSForm!Pro PDF plugin by default and is also kept for legacy reasons).

A similar message should be displayed under Components > RSForm!Pro > Configuration > PDF tab:

You're running PHP 8 or newer - please use either dompdf v1.x, v2.x or mPDF since dompdf v0.8.3 will produce errors.

In order to fix this, you will need to include either 'dompdf v1.x library',  'dompdf v2.x library' or 'mPDF library' in order generate your PDF files as they are more reliable. Steps to take (you can also find these steps here):

  • download the dompdf archive from "My downloads" section > RSForm!Pro - Modules & Plugins > 3rd Party > "Library - dompdf 2.x" / "Library - dompdf 1.x" / "Library - mPDF" > Download.
  • Install it through Extensions Manager (if your server allows uploads of 4M+), otherwise:
    • unzip the archives.
    • using your FTP account, place their contents under the following path (basically the following "pdf" folder should have a "dompdf" folder containing the dompdf library files): administrator/components/com_rsform/helpers/pdf/
    • You should end up with a folder for each library named dompdf10 / dompdf20 / mPDF inside administrator/components/com_rsform/helpers/pdf/ the dompdf 1.x / dompdf 2.x / mPDF libraries can be then selected from the PDF Library option (Components > RSForm!Pro > Configuration > PDF)

Once this is done navigate to backend > Components > RSForm!Pro > Configuration > PDF > set 'PDF Library' to either 'dompdf v1.x', 'dompdf v2.x' or 'mPDF', save your settings, and then test this once more.

 

6 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that