0

I read the links of the pdf document in a new page using the code below but I only have the blank page

@section('content')
<div class="content">
  <div class="container-fluid">
    <div class="card card-plain">
      <div class="card-header card-header-primary">
        <h4 class="card-title">Cotations</h4>
        <p class="card-category">lorem ipsum lorem ipsum
        </p>
      </div>
      <div class="card-body">
        <div class="row">

          <div class="col-md-12">
            <a href="D:\Cumputers\Dark Deb\Hunchly-Dark-Web-Setup.pdf" target="_blank">Hunchly-Dark-Web-Setup.pdf</a>
          </div>

        </div>
      </div>
    </div>
  </div>
</div>
@endsection
malela
  • 1
  • 1
  • Can you please elaborate? Are you trying to embed a PDF file into your site or you wanted a link on your site that will redirect to that PDF file? – PlanetCloud Sep 10 '19 at 12:40
  • You can't access your system's folder in your laravel ,unless you have added the filesystem in app/filesystems.php – farooq Sep 10 '19 at 12:41
  • 1
    You are not “reading” any links here, you have simply set a link that tries to refer to a PDF document in your local file system. Tries to, because this is missing the protocol (https://stackoverflow.com/questions/18246053), right now you have just referred to a weirdly named “folder” below the current one. This should probably not be done via the file system in the first place though. – misorude Sep 10 '19 at 12:43

3 Answers3

1

You can check out this post about embedding PDF files on your webpage. HTML embedded PDF iframe

What I've done in the past is used an iframe to achieve this, like so:

<iframe style="border:1px solid #666CCC" title="My PDF" src="my-pdf.pdf" frameborder="1" scrolling="auto" height="1100" width="850" ></iframe>
Full Stack Alien
  • 11,244
  • 1
  • 24
  • 37
0

you can use object tag

@section('content')
<div class="content">
  <div class="container-fluid">
    <div class="card card-plain">
      <div class="card-header card-header-primary">
        <h4 class="card-title">Cotations</h4>
        <p class="card-category">lorem ipsum lorem ipsum
        </p>
      </div>
      <div class="card-body">
        <div class="row">

          <div class="col-md-12">
           
           <!-- pdf here -->
           <object width="400" height="400" data="http://plugindoc.mozdev.org/testpages/test.pdf">
</object>

          <!-- pdf here -->
          <!-- or iframe -->
          <iframe src="http://plugindoc.mozdev.org/testpages/test.pdf" width="400" height="400" frameborder="0"></iframe>
            
          </div>

        </div>
      </div>
    </div>
  </div>
</div>
@endsection
Otávio Barreto
  • 1,536
  • 3
  • 16
  • 35
0

Thanks @Otavio and @jass. I tried it with ifram and it work.

<iframe style="border:none" src="{{URL::asset('/material/docs/laravel-PDF/laravel.pdf')}}"  scrolling="auto" height="700" class="col-md-10"></iframe>

I wanted to specify also that we had to use the link the way laravel does it

malela
  • 1
  • 1