[RESOLVED] Gravify PDF suddenly did not send attachment along with email

Gravify PDF suddenly did not send attachment along with notification email, it was working all morning.

And when I went to check Entries > View PDF, I encountered this error.

HTTP error “404” for https://xxxxxxxxxx.org.xx/wp-content/plugins/gravity-pdf/initialisation/template.css in /home/customer/www/xxxxxxxxxx.org.xx/public_html/wp-content/plugins/gravity-pdf/src/Helper/Mpdf/Request.php on line 79

The error appears also for successfully generated PDF for submissions that I received this morning. All Entries > View PDF previews successfully generated in the past no longer work, and shows the error.

I would like to add the following points, in the hope that it would assist in identifying the problem sooner / easier:

  • the 404 error message refers to initialization/template.css but this does not exist on the server.
  • a fresh download of the Gravity PDF plugin also does not include the initialization folder or the css file.
  • the Gravity PDF files/folders are all time-stamped 2025-07-24 3:00:39 pm. At this time too, UpdraftPlus created an auto backup (of the database and plugins folder) before an automatic update took place.
  • I have not attempted to re-install the plugin as yet - awaiting a reply from Gravity PDF on next steps.

The issue is resolved, it was due to a conflict with Fresh Forms. Mod may close this thread.

Hey @user614aaa34aec93107,

I replied to your support ticket with greater detail, but I’m also going to post a more generalized recap of the problem and solution for anyone else reading this who is in a similar situation.


I see you mentioned this was a conflict with Fresh Forms, but based on the errors you sent over this isn’t likely the root cause. I suspect it’s a bunch of smaller issues that have compounded into this error due to the fact you’ve been using Gravity PDF on this website for a looong time.

Before you make any changes, create a backup of your website. Should something go wrong you can easily restore your backup.

PHP Error

In the 6.13 update, the PDF engine’s asset loader (CSS and images) got an upgrade and this has been tied in with WordPress’ debug mode. When debug mode is enabled and a PDF is generated, asset-loading errors will be displayed to administrators on-screen – instead of being silently ignored. To turn off this developer feature you will need to edit your site’s wp-config.php file and either disable WP debug mode or hide errors from displaying.

Disable debug mode entirely (recommended in production environments):

define( 'WP_DEBUG', false ); 

Or, keep debug mode enabled but hide errors and warnings on screen:

define( 'WP_DEBUG', true ); 
define( 'WP_DEBUG_DISPLAY', false );

Importantly, if your wp-config.php file already has these lines don’t add additional copies of them. Replace/modify the existing lines.

After making this change, check your PDF will now generate from the Entry List page.

Missing CSS File

Now let’s discuss the error itself:

HTTP error “404” for https://xxxxxxxxxx.org.xx/wp-content/plugins/gravity-pdf/initialisation/template.css in /home/customer/www/xxxxxxxxxx.org.xx/public_html/wp-content/plugins/gravity-pdf/src/Helper/Mpdf/Request.php on line 79

This CSS file was something we shipped in Gravity PDF v3, but it was deprecated in the v4 release (2016), and finally removed from the plugin in v6 (2019). That’s the reason you weren’t able to find the CSS file in the Gravity PDF plugin.

In the Gravity PDF v5 to v6 Migration Guide, one of the recommended steps was to update any custom PDF template(s) and either remove reference to the template.css file, or inline the styles. Since you haven’t noticed any display issues before now, it would be safe to remove the reference entirely.

The code you need to remove probably looks like this:

<link rel='stylesheet' href='<?php echo PDF_PLUGIN_URL .'initialisation/template.css'; ?>' type='text/css' />

On a standard installation, you’ll find the PDF Working Directory at /wp-content/uploads/PDF_EXTENDED_TEMPLATES/ on the server. You should review each template in this directory and remove this reference.

Audit Your Custom Templates

Over the years the custom template structure has evolved and been simplified. It’s recommended you audit your custom templates and make sure they follow the latest structure. If your custom templates are copies of a Core template, you can compare them to the latest Core template code. If you’ve templates in here that you don’t use, consider deleting them.

All the best.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.