PDF Embedder Documentation

Documentation, Reference Materials, and Tutorials for PDF Embedder

Get access to
Powerful Features!

Home » Documentation » Troubleshooting » Invalid PDF Structure

Invalid PDF Structure

The “Invalid PDF Structure” error usually has a simple fix — follow the steps below before reaching out for support.

This error typically occurs due to a server configuration problem. Either the encrypted PDF file isn’t being streamed correctly to the browser (often because gzip compression is being applied incorrectly to the file), or the decryption key stored in the browser is stale and no longer matches the server’s current key.

Step 1: Reload the page

The issue may be a one-off caused by a temporary network glitch or an expired browser cache. Reload the page and check whether the PDF displays correctly. If it does, no further action is needed.

Step 2: Clear your site’s cache

A stale cache can cause the browser to receive an outdated or mismatched decryption key. Use your caching plugin to purge all cached files. Common plugins include WP Super Cache, W3 Total Cache, WP Rocket, and LiteSpeed Cache. After clearing, reload the page to test.

Step 3: Disable caching for the PDF page

To prevent the issue from recurring, configure your caching plugin to exclude the page containing the secure PDF from being cached. This ensures the browser always receives the latest decryption key, rather than a cached (and potentially stale) version.

You can read more about PDF Embedder and caching plugins in this article.

Step 4: Check your server’s gzip compression settings

If your server applies gzip compression to all file types, it may be incorrectly compressing the PDF stream, which corrupts the delivery to the browser. You may need to add an exception in your .htaccess file (if yuou use Apache or LiteSpeed) or server configuration (for Nginx and Caddy) to exclude PDF files from gzip compression. If you’re unsure how to do this, contact your hosting provider.

Still not working? Contact support

If none of the above steps resolve the issue, please get in touch and we’ll help diagnose the exact cause. When you reach out, it helps to include the URL of the page showing the error and the name of your hosting provider.

If you already have an account on wp-pdf.com, you can use your Account Support page to speed up the process.

Still have questions? We’re here to help!

Last Modified: