YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.74k stars 749 forks source link

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

Closed BKLTMS closed 6 months ago

BKLTMS commented 7 months ago

🐞 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 commented 6 months ago

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

BKLTMS commented 6 months ago

Yetiforce engine

davide-alghi commented 6 months ago

@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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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

BKLTMS commented 6 months ago

Thanks for the assistance and suggestions!

BKLTMS commented 6 months ago

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 commented 6 months ago

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?

BKLTMS commented 5 months ago

Here is the section you were asking for:

Hope this is of assistance.

BKLTMS commented 5 months ago

Reposting as an image as it is not being allowed to show as text in the previous comment: image

RajasekaranJeni commented 5 months ago

Hi,

Yes i required this syntax only and also could you please share the folder path to add the custom fonts?

Thanks

BKLTMS commented 5 months ago

https://github.com/YetiForceCompany/YetiForcePDF#custom-fonts

deepti4666 commented 5 months ago

my pdf export worked before the upgrade to Yetiforce 7.0 - now it doesn't want to accept the logo.

RajasekaranJeni commented 3 months ago

https://github.com/YetiForceCompany/YetiForcePDF#custom-fonts

hi,

Thanks for your inputs and now i can generate the quotes with custom fonts. But the PDF output doesnt display the indian currency symbol.

image

Now, i am generating the product table using below syntax. $(inventory : type=table columns=seq,comment1,qty,unit,total,tax , href=no , labels=SNo,Product Description,Qty,Unit,Product Price, Tax , width=10px,225px,50px,45px,105px,95px )$

sometimes the alignment is not working as expected. is there any alternative method available to generate the product table?

Thanks & regards, Rajasekaran.