If you are having issues with PDF document generation and getting an error like “Failed to load PDF document,” there are a number of things to check. In my case, it seems to be a dependency for a WordPress plugin that is incompatible with Redis. In my case, I just temporarily turned off Redis and restarted Nginx, and the .pdf file generated fine. Of course, this is not a permanent solution, but it for this instance it works. Soon, I will work on finding out why the issue persists when Redis is turned on.

However, there can be a couple of other things to check as well as Redis:

  1. Invalid URL or path to the PDF file
  2. The PDF file is corrupted or damaged
  3. Insufficient permissions to access the PDF file
  4. The file format is not supported by the PDF viewer
  5. The PDF viewer is outdated or not configured correctly

To resolve the issue, you can try the following steps:

  1. Check if the URL or path to the PDF file is correct and try accessing it directly.
  2. If the file is corrupt, try to repair or recover it.
  3. Ensure that you have sufficient permissions to access the file.
  4. Try opening the file with a different PDF viewer to see if it is a compatibility issue.
  5. If the issue persists, try updating or reinstalling the PDF viewer.