Embed Pdf - Question | JoomShaper
🎃 Halloween Sale is Live! Get 35% OFF on all plans. Sale ends soon! Get Offer

Embed Pdf

B

bageo

SP Page Builder 3 months ago

Hello I want to show a pdf in an article using the code I found from an older post of you: <object data="/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded85bfc.pdf" type="application/pdf" width="100%" height="500px"> <p>Unable to display PDF file. <a href="/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded85bfc.pdf">Download</a> instead.</p> </object>

    this works fine when I visit my site from a pc but not from any mobile ...
    I installed PDF Embed plugin but doesnt work either 
    what can I do??
0
2 Answers
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 3 months ago #198360

Hi,

In general, is not recommended to use PDF as viewer on mobile devices. This format is not Mobile friendly. That's why use download link under.


I can share an example, that may help you a little bit, but it's beyond JoomShaper support (!) Use it inside Raw HTML addon. BTW On iOS (Safari), PDF preview may be limited.

HTML Code

  <div class="pdf-container">
    <object 
      data="path/to-your-file.pdf#toolbar=0&navpanes=0" 
      type="application/pdf">
      <p>Your browser does not support PDF preview. 
         <a href="/path/to-your-file.pdf">Download PDF file</a>.
      </p>
    </object>
  </div>

CSS code (use it inside Page Settings > Page CSS > CSS or Template options > Custom code > Custom CSS)

.pdf-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;}
  object {
      width: 100%;
      height: 100%;
      border: none;}
0
B
bageo
Accepted Answer
3 months ago #198361

thanks a lot

0