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

[bug] Error on PDF generation PHP8 & above #17430

Closed
2 tasks
BKLTMS opened this issue Apr 18, 2024 · 11 comments
Closed
2 tasks

[bug] Error on PDF generation PHP8 & above #17430

BKLTMS opened this issue Apr 18, 2024 · 11 comments

Comments

@BKLTMS
Copy link

BKLTMS commented Apr 18, 2024

🐞 bug report

⁉️ Describe the bug

Version 6.5: All works fine when generating a PDF with PHP7.4. However, when PHP is upgraded to PHP8 or above, PDF generation delivers the screenshot below. Reverting back to PHP7.4 resolves this and generation works again.

Screenshot 2024-04-18 115832

Logs not indicating anything on this error.

Any assistance is appreciated - thank you,


🔥 How to trigger the error

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

👎 Actual Behavior

👍 Expected Behavior

👷 Testing

📷 Screenshot of configuration

📝 PHP/Apache/Nginx/Browser/CRM Logs

🌍 Your Environment

Environment Version / Name
YetiForce
Web server (name and version)
PHP
Browser (name and version)
Operating System (name and version) CentOS & Apache
Database (name and version) MariaDB 10.6
Service Pack version

❓ Additional context

Add any other context about the problem here.

❗️ Inform the community if you solve the problem

@davide-alghi
Copy link
Contributor

@BKLTMS
what is the engine? the built-in one (YetiForce engine) or Google Chrome engine?

@BKLTMS
Copy link
Author

BKLTMS commented Apr 22, 2024

Yetiforce engine

@davide-alghi
Copy link
Contributor

@BKLTMS
YetiForce PDF engine is not a champion in memory management: if the PDF template has a lot of content it could crash.
Try generating a PDF, via YetiForce engine, with a very small PDF template: with only a small text in the "Content" field to see if the PDF is generated.

@BKLTMS
Copy link
Author

BKLTMS commented Apr 23, 2024

Thank you for your response and assistance.
I did as suggested and the smaller template did generate under PHP 8.0.30.
We need to use the templates as they are; is there a solution to make the Yetiforce PDF engine more memory friendly with PHP 8 and above?
As indicated above, all our templates work and generate fine with PHP 7.4.33.

Much appreciated!

@RajasekaranJeni
Copy link

Hi,

Please check the memory limit in the php.ini file.

When i changed the php version, it switched to default memory limit as 128MB and created the error in PDF generation.
After increasing the memory limit to 1GB, it was solved. Please check the server configuration for php8, it may solve the error.

Thanks.

@BKLTMS
Copy link
Author

BKLTMS commented Apr 28, 2024

Thanks for the suggestion. Changed memory limit to 1GB. Unfortunately getting the same error.
Any other advice or suggestions to troubleshoot?
Thanks and appreciated!

@RajasekaranJeni
Copy link

hi,

when my quotation having too many products or long descriptions, sometimes faced this error.

Try to generate it the pdf with 1 or 2 products. if PDF generation is successful, increase the memory limit and / or maximum execution time. This worked for me.

Please try this and share the results.

@davide-alghi
Copy link
Contributor

@BKLTMS
you have two ways: split the PDF template in smaller templates, or buy a Google Chrome PDF engine extension

@BKLTMS
Copy link
Author

BKLTMS commented Apr 30, 2024

Thanks for the assistance and suggestions!

@BKLTMS BKLTMS closed this as completed Apr 30, 2024
@BKLTMS
Copy link
Author

BKLTMS commented May 10, 2024

As a follow-up after closing: Found issue to be with the line-height code in the source. They were using % for the value, once changed to a number value (i.e.- 1.5 or .9), all templates generated as expected with PHP 8.0.30.

@RajasekaranJeni
Copy link

its nice to hear that issue was fixed.

Cloud you please share the column width and height adjustment section?

and have you tried to change the fonts? if you succeed, could you please share the procedure for changing the fonts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants