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.