0

I have web page to show and download uploaded pdf files so I need to show pdf content on web page i have already created a page for images I have to use pdf instead of images

following is my view:

<div class="row">
<?php foreach ($rowData as $key => $row) {
    ?>
    <div class="col-md-3">
        <div class="card" style="width: 15rem;">
            <?php
            $allowed = array('png', 'jpg');
            $filename = $row->file;
            $ext = pathinfo($filename, PATHINFO_EXTENSION);
            if (!in_array($ext, $allowed)) {
                //echo ' <img class="card-img-top" src="http://via.placeholder.com/350x150" alt="" height="300">';
                ?>
                <img class="card-img-top" src="{{asset('/uploads/images/no-image.png')}}" alt="" height="250">
            <?php
            } else {
                ?>
                <img class="card-img-top" src="{{asset('/uploads/downloads/'.$row->file)}}" alt="http://via.placeholder.com/350x350" height="250">
            <?php } ?> 
            <div class="card-block">
                <h6 class="card-title">{{$row->title}}</h6>
                &nbsp &nbsp &nbsp &nbsp &nbsp   <a download="{{$row->file}}" href="{!! asset('/uploads/downloads/'.$row->file) !!}" target="_blank" role="button" class="btn btn-primary btn-sm">Download</a>
            </div>
        </div> 
    </div>
    <?php }
?>
</div>

I would like to create pdf viewer like this click.

Rummaan
  • 41
  • 1
  • 2
  • 9

1 Answers1

0

you can use DomPDf in laravel.