• Resolved yeungmanlung

    (@yeungmanlung)


    We have noticed that the PDF Embedder plugin cannot correctly retrieve the PDF ID for some PDFs, defaulting to 0. This causes multiple PDFs with ID 0 on the same page, and when the full-screen mode is activated, the plugin’s JavaScript always refers to the first PDF. This may be due to a bug or a version mismatch between the PDF Embedder plugin and the current WordPress version. The plugin is tested up to version 6.5.5, but we are using version 6.6+.

    The following site shows the problem.

    Project 5 – ART 250 / MCOM 231 (twu.ca)

    The first PDF is fine because the PDF is retrieved perfectly. But the others are not. When the problematic PDF in mobile, they always show the first one with ID 0.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Nukak Asanansi

    (@nasanansi)

    Hi @yeungmanlung,

    Thanks for reaching out.

    The times we have seen this issue, it’s usually due to the PDFs being rendered in some other format besides the shortcode or block editor.

    If you are rendering the PDFs via some other method besides these, please follow our guide below on how to properly embed the PDFs without generating any such conflicts:

    https://wp-pdf.com/premium-instructions/#embedding-a-pdf

    https://wp-pdf.com/premium-instructions/shortcodes/

    I hope this helps. Thanks ??

    Thread Starter yeungmanlung

    (@yeungmanlung)

    it is weird because we are indeed using pdf-embedder shortcode. We have try if we reupload the PDF then the new PDF would work fine. But some old PDFs are not. Any guide for us to debug.

    Plugin Support Nukak Asanansi

    (@nasanansi)

    Hi @yeungmanlung,

    Thank you for clarifying that you are using the pdf-embedder shortcode. I understand how frustrating this can be when it’s affecting a good number of your PDFs.

    Sometimes, metadata issues or file corruption can cause some issues in retrieving the correct ID. This might explain why re-uploading the PDFs resolves the issue.

    I suggest checking on the server side to see if there are any changes that could’ve occurred to cause this. If there was also a recent migration of your site, it could have caused this. Database corruption, malware, and security settings could also have triggered this on your site. So please look into these options as well.

    If you are unable to identify the exact cause, the next best step would be to re-upload the files.

    ?I apologize that we are unable?to provide an immediate solution to this. But I do hope the information provided above can?help point you in the right direction.

    Thanks ??

    We are also getting this for many of our PDF’s as well. We’ve tried relinking documents that were working previously but its hit and miss. Some work and some don’t.

    Error – Failed to fetch.

    This is a real problem as we have many back issues of our magazine linked and the majority are not working.

    Our WP version is 6.61, PDF Embedder is 4.8.2 and PDF Embedder Premium is 5.2.3

    Plugin Support Nukak Asanansi

    (@nasanansi)

    Hi @brustar,

    Thanks for getting back to us with the error message.

    The Failed to Fetch error usually happens when the PDF you are trying to embed is being served from a different domain or sub-domain from where it is being displayed. For example, if you embed the PDF on the domain https://domain.com, an error will result if the PDF is served from:

    • a different domain: https://site.com,
    • a different domain:?https://s3.amazonaws.com/domain.com/
    • a different sub-domain:?https://domain.com,
    • a different sub-domain:?https://www.domain.com,
    • a different sub-domain:?https://domain.com/en/

    If you are using an SSL certificate, you may have an issue where the front end and back end of your site are not under the same protocol (i.e. http vs. https). If you are using redirects, you may have a situation where the backend is under the “www.domain.com” sub-domain, but the front end is just “domain.com”. This will trigger the Failed to Fetch error.

    These are all fixes you need to do at the server / WP installation level. For more information on this error, please see: 

    https://wp-pdf.com/kb/failed-to-fetch/

    If you are serving the PDFs from a CDN such as Amazon S3 or perhaps even your webhost (i.e. WPEngine uses a CDN), you will need to set up a CORS (cross-origin resource sharing) configuration to meet the browsers security requirements to eliminate this error. We have instructions on how to set up a typical CORS config here:

    https://wp-pdf.com/kb/hosting-pdfs-on-other-services-such-as-amazon-s3/

    If you see an error in the browser’s Developer Tools > Console tab regarding Access-Control-Allow-Origin header, there is a fix for that in the same documentation.

    I hope this is helpful. Thanks ??

    Hi Nukak,

    We are not hosting our PDF’s on a different domain.

    We are using an SSL certificate. For some reason the PDF embedder URL’s are not including the “s” in “https”. If i edit the shortcode it fixes it.

    If i re-add the media it works on the main site. We’ve had the SSL certificate for the entire life of the site. Not sure what might be causing the issue all of a sudden.

    In some of the subsites we are getting another issue where the permalink for the media is correct but the actual media link doesn’t have a HTTPS URL. FYI we are not using subdomains, just subfolders.

    Very strange…

    • This reply was modified 2 months, 3 weeks ago by brustar.
    Plugin Support Nukak Asanansi

    (@nasanansi)

    Hi @brustar,

    Yes, the HTTPS not included in the PDF URL is a common cause of this error.

    Some steps you can take to fix this are to ensure that your website settings are correctly configured to use HTTPS:

    • Update the Site URL and WordPress URL to use HTTPS. You can do this from your WordPress dashboard (Settings > General)
    • Update any hardcoded HTTP links in your theme files, plugins, or media library.

    ?You can also set up a redirect on your server to automatically redirect HTTP requests to HTTPS. This can often be done via your server configuration files (like?.htaccess?for Apache, or server block configuration for Nginx).
    ?
    ?If you need technical help around these, please reach out to your hosting provider as most usually help with these types of web server configurations.

    Thanks ??

    Thanks very much! That solved it.

    Cheers ??

    Plugin Support Nukak Asanansi

    (@nasanansi)

    Hi @brustar,

    You’re welcome! I’m glad that helped ??

    Have a great weekend.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.