0

How can I display a PDF in a Laravel View like I can display a normal image?

The code I am using to implement an image is:

<div class="u-img">
    <img 
        src="image/{{ Auth::user()->photo_jpeg }}" 
        alt="profile"
    />
</div>

What options/HTML-tags can I use to display a PDF?

liqSTAR
  • 1,225
  • 1
  • 12
  • 22
Ramu Ramu
  • 27
  • 2
  • 13
  • Check this out: https://stackoverflow.com/questions/25938294/laravel-display-a-pdf-file-in-storage-without-forcing-download – liqSTAR May 31 '19 at 10:54

2 Answers2

0

you could use an object

  <object data="/path/to/pdf.pdf"  type="application/pdf">

  </object>
0

you could use an iframe

<iframe src="http://example.com/pdf-sample.pdf" id="pdf_display_frame" width="100%" height="500px"></iframe>
sunny bhadania
  • 423
  • 3
  • 5