I don’t use a viewer plugin but just an HTML element that uses the browser’s native viewer

Inside an HTML element do:

<html>
  <body>
    <object data="[insert dynamic file URL here]" type="application/pdf" width="100%" height="100%">
      <p>Unable to display PDF. <a href="[insert dynamic file URL here]">Download</a> instead.</p>
    </object>
  </body>
</html>

I am not sure if it works on mobile browsers so instead it falls back to showing text to download it.

1 Like