Skip to main content
Tweeted twitter.com/#!/StackSharePoint/status/202084742353522688
Tried to clarify when I was using my personal experience over general fact.
Source Link
RWL01
  • 1.3k
  • 4
  • 21
  • 43

Question

Is it possible to view a PDF through an iframe that is stored in a SharePoint 2010 document library? If so, what changes do I need to make to the default document library settings?

Background

I want to display a PDF that is stored in a document library through an iframe. Currently this works without any issues when the PDF is stored in a _layouts sub-folder. When I store it in a document library I'm only given the option to save it locally. Below is the test HTML I used to validate this.

<html>
<body>
    Document Library: Forces user to download the document
    <iframe height="300" width="300" 
        src="http://sprocks/Shared%20Documents/DTest%2001test01.pdf" />

    _layouts sub-folder: Renders as expected in the iframe
    <iframe height="300" width="300" 
        src="http://devsp2:3050sprocks/_layouts/APC.trccomments/CachedReports/mwr686test01.pdf" />
</body>
</html>

Question

Is it possible to view a PDF through an iframe that is stored in a SharePoint 2010 document library? If so, what changes do I need to make to the default document library settings?

Background

I want to display a PDF that is stored in a document library through an iframe. Currently this works without any issues when the PDF is stored in a _layouts sub-folder. When I store it in a document library I'm only given the option to save it locally. Below is the test HTML I used to validate this.

<html>
<body>
    Document Library
    <iframe height="300" width="300" 
        src="http://sprocks/Shared%20Documents/DTest%2001.pdf" />

    _layouts sub-folder
    <iframe height="300" width="300" 
        src="http://devsp2:3050/_layouts/APC.trccomments/CachedReports/mwr686.pdf" />
</body>
</html>

Question

Is it possible to view a PDF through an iframe that is stored in a SharePoint 2010 document library? If so, what changes do I need to make to the default document library settings?

Background

I want to display a PDF that is stored in a document library through an iframe. Currently this works without any issues when the PDF is stored in a _layouts sub-folder. When I store it in a document library I'm only given the option to save it locally. Below is the test HTML I used to validate this.

<html>
<body>
    Document Library: Forces user to download the document
    <iframe height="300" width="300" 
        src="http://sprocks/Shared%20Documents/test01.pdf" />

    _layouts sub-folder: Renders as expected in the iframe
    <iframe height="300" width="300" 
        src="http://sprocks/_layouts/CachedReports/test01.pdf" />
</body>
</html>
Source Link
RWL01
  • 1.3k
  • 4
  • 21
  • 43

Using an iframe to view a PDF stored in a SharePoint document library

Question

Is it possible to view a PDF through an iframe that is stored in a SharePoint 2010 document library? If so, what changes do I need to make to the default document library settings?

Background

I want to display a PDF that is stored in a document library through an iframe. Currently this works without any issues when the PDF is stored in a _layouts sub-folder. When I store it in a document library I'm only given the option to save it locally. Below is the test HTML I used to validate this.

<html>
<body>
    Document Library
    <iframe height="300" width="300" 
        src="http://sprocks/Shared%20Documents/DTest%2001.pdf" />

    _layouts sub-folder
    <iframe height="300" width="300" 
        src="http://devsp2:3050/_layouts/APC.trccomments/CachedReports/mwr686.pdf" />
</body>
</html>