Generating PDF from Contracts Module is blank

I am generating 2 PDFs (Print PDF) from Contracts module. Have Contact, Account, Opportunities Fields filled in Contracts module. One of the PDF is returning blank page. The other PDF is just printing the field names and not the parsed result i.e. ($billing_account_billing_address_city, $billing_account_billing_address_state)

I need help on this, I am really deep trouble.

Using SuiteCRM Version 7.8.3 (Sugar Version 6.5.24 (Build 509))

If you can, please consider an upgrade to the latest 7.8.10, there have been tons of bug fixes (and security fixes!). Make sure you backup first, as always before an upgrade.

Other than that, check your logs for any clues at the moment of generating the PDF.

I upgraded to 7.8.10. Still no luck. In the Suitecrm Log, all i see is below repeated multiple times

Sun Jan 14 23:40:45 2018 [2241][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone=“UTC” in php.ini!
Sun Jan 14 23:41:45 2018 [1542][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone=“UTC” in php.ini!
Sun Jan 14 23:42:46 2018 [2038][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone=“UTC” in php.ini!

You have to fix those errors, they’re fatal.

Just configure the timezone in your php.ini.

If the errors come every minute, they’re probably from the cron jobs (if you have them running!). In that case you might need to configure a second php.ini (for the CLI).

I have set the date.timezone setting on php.ini file in etc/php/7.0/apache2

I am still getting the errors, so like you said it could be from the cronjobs. Can you please elaborate on “In that case you might need to configure a second php.ini (for the CLI).”

There are two PHP’s running, one for SuiteCRM web app, one for command-line (CLI) which is probably what your cron jobs are using.

On a command-line type this

php -i | grep Configuration

This should tell you the path to your CLI’s php.ini

I am assuming you are using your own server, if it is shared hosting you might need some extra tricks to get this setting done.

Oh, and while you are editing php.ini you might want to (for example):

  • raise memory_limit to 512 MB
  • raise max_execution_time to 120 seconds
  • raise max_upload_size to 10 MB

In the suitecrm.log, the PHP time zone error has stopped. Apparently I had to restart the server after making the changes. Duh!!
You are right, it is a self hosted server on cloud.

I tried creating the PDF again, as my original post was. the page generated is blank, through I have selected the variables to display while designing the PDF template. There is no error spitted in suitecrm.log file on the same.

Can you get access to the web server’s logs? Normally they’re in php_errors.log, and they show relevant information especially when there’s a white screen, which is usually caused by a PHP fatal error.

It’s hard to fix it if we don’t know what’s happening…

Not sure why, but I deleted all PDF templates after upgrading Suitecrm to 7.8.10 and created them from scratch. It is all working fine now.

Thank you so much.

In version Version 7.11.13
Sugar Version 6.5.25 (Build 344)
on ubuntu i made the following changes to fix the blank screen.
I commented out the following code line from
@mb_regex_encoding(‘UTF-8’);
from the file
modules/AOS_PDF_Templates/PDF_lib/mpdf.php