• Resolved medialps

    (@medialps)


    I am using https://ampforwp.com/ to generate AMP pages for the mobile version, and PDFs are not shown, only a frame with html code appears:

    Is there a solution to this problem?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @medialps,

    Thanks for reaching out, and I’m so sorry about the inconvenience.

    The issue with PDFs not displaying on AMP pages is most likely due to AMP’s restrictions on HTML and JavaScript, which can prevent the proper rendering of embedded content like PDFs.

    In case it helps, here are some possible workarounds you can look into:

    1)  Use Direct PDF Links: You can provide a direct link to the PDF, allowing users to view or download it outside of the AMP environment.

    2)  Convert PDFs: Converting PDFs into images or text snippets that are AMP-compatible might be a viable alternative.

    I hope this helps. Thanks ??

    Thread Starter medialps

    (@medialps)

    It would be interesting for the script to detect the word AMP in the URL (normally used) and directly show the link to the PDF instead of the viewer, no?

    Hi @medialps,

    Thanks for the suggestion.

    I think it’s a good idea to automatically provide a direct link to the PDF if the page is being viewed in AMP mode. I’ll share this with the team to see if this can be considered for future development planning.

    While our plugin doesn’t currently have this feature, you could possibly implement this by adding a script that detects “AMP” in the URL. If detected, the script can replace the viewer with a direct download link.

    This will require some custom coding, so you may want to consult with a developer.

    Thanks once again ??

    Thread Starter medialps

    (@medialps)

    What is the best file to edit? pdf_embedder.php?

    Hi @medialps.

    It’s generally not recommended to directly edit core plugin files like pdf_embedder.php because these changes can be lost when the plugin is updated.

    I’d recommend using the WPCode plugin:?https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/. This will protect your code from updates and keep it easy to manage right within your WordPress admin area.

    I hope this helps. Thanks ??

    Hi @medialps,

    We haven’t heard back from you yet, so I’ll be closing this thread for now.

    If you still run into any issues, please feel free to reply, and we’ll take a look. 

    Have a good one ??

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