• Resolved mateusvitor

    (@mateusvitor)


    I need to display multiple PDFs in the same page.
    Is there anyway of changing the file with a javascript button, without needing to reload the page?
    I believe having more than one block will make the page slow as some of the files might be heavy.
    Thank you for the plugin, it has worked perfectly till now.

Viewing 1 replies (of 1 total)
  • Hi @mateusvitor,

    There are two ways to handle this:

    1. Use a text or image link to the PDF’s attachment page. This way you can show the title or cover image of the document but have only the document the visitor wants to read open when they navigate the link. There is an example of this in our FAQ: Add multiple PDFs to a single page (note: this method does require the paid version of the plugin)
    2. The other method requires some coding on your part. You would need to create a button with an onClick action to load the PDF:
    • Use ajax to run the shortcode on button click.
    • Get the shortcode result and set it in search result page
    • Reload the scripts needed for the plugin using the following code: [ jQuery('.pdfemb-viewer').pdfEmbedder(); ]
    • Triggering PDF Embedder scripts

    I hope that one of these suggestions will help you out. If you have any other questions, please feel free to send an email to [email protected] as we may not see messages posted here to respond in a timely fashion.

    Emma

Viewing 1 replies (of 1 total)
  • The topic ‘Multiple embedded PDFs in one page’ is closed to new replies.