Looks like it was the dynamic content problem that the other support question brought up, which the plugin author already answered 🙂
If anyone is using this for Woocommerce single product page, just add the code below to your wp-config.php
define('DISABLE_PDF_CACHE', true);
Hi!
Thanks for using our plugin. I’m glad you found a solution to your problem.
However, since WooCommerce product pages should be fairly static, this isn’t really the same issue as the dynamic post content problem. There wasn’t an issue opening the PDF file in that case either. I for one, have successfully used this plugin with caching enabled on WooCommerce single product pages.
I suspect the real issue here lies with file permissions. The only difference DISABLE_PDF_CACHE makes, is that it doesn’t try to write the PDF file on disk.
The error message “Failed to Load PDF document” sounds like the PDF file doesn’t exist in your uploads directory, which could be due to bad write permissions. Are you getting any errors or warnings in your php error log when using the cache?
You can try adding this to your wp-config.php to see if wp-pdf-templates gets any errors during PDF generation.
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
Although, if the PDFs generate fast enough for you, and you have server performance to spare, perhaps the caching functionality isn’t even needed here. Why fix something that’s not broken? 🙂
Cheers!
Antti
Hi Antti,
Thanks for the swift response.
I checked the php error log with the cache on and not seeing any relevant errors added.
I also tried adding your code to my wp-config.php, but getting the same “Failed to Load PDF document” message.
Either way, You nailed it on the head, it ain’t broke 🙂
Since we are setting this up to print product labels by internally staff, I don’t think it will be used frequent enough to put any load on the server.
Did I mention, I’m Really glad you’ve created this plugin!
At your service! Hope the plugin comes in useful.
If you like, you can review the plugin to help spread the word. 🙂
[thread marked as resolved]