Click here to Skip to main content
15,351,089 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more: , +
I have tried with iframe , embed and object but nothing gives me the output.

What I have tried:

<link href="" rel="stylesheet" />
    <script src=""></script>
    <script src=""></script>

<div class="c-modal__dialog" role="document">
    <div class="c-modal__content">
      <div class="c-modal__header c-modal__header--success">
        <h5 class="c-modal__title">Floor Plan</h5>
      <div class="c-modal__body">        
        <iframe src="~file:///C:/uploads/d094a66c-c941-4e1a-98ae-f96aca4048ac.pdf" style="width:680px;max-width:680px; height:500px;" frameborder="0"></iframe>
        <embed src="~file:///C:/uploads/d094a66c-c941-4e1a-98ae-f96aca4048ac.pdf" frameborder="0" style="width:100%;height:600px">
        <object type="application/pdf" data="~file:///C:/uploads/d094a66c-c941-4e1a-98ae-f96aca4048ac.pdf" style="width:100%;height:600px">No Support</object>
      <div class="c-modal__footer u-text-right">
        <button type="button" class="c-btn c-btn--secondary" modal-close>Close</button>
Updated 3-Feb-22 21:19pm
F-ES Sitecore 27-Aug-19 4:05am
The problem is that it is a local file and these days browsers tend to not like accessing local files for security reasons. Google "show local pdf file iframe" for questions about similar issues, but there is no universal solution that I'm aware of.

If it isn't a local file and the "c:\uploads" path is on the web server then you need to use an http path to the file on the server. If the file is outside of the websites file structure then you'll need some intermediate page on the website that will stream the desired file to the client. If you google " stream pdf file to client" you'll probably find examples of how to do that.

You can use Google Doc :

<iframe src="" style="width:600px; height:500px;" frameborder="0"></iframe>

But your file must be online.
You can also embed the pdf inside the modal. Like this:
<embed src="sample.pdf" frameborder="0" width="100%" height="400px">
That worked for me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900