Display PDF Or Tiff Files In IFrame

How to Display PDF Or Tiff Files In IFrame in Asp.net C#


Example:  In this application how to display PDF or tiff files in IFrame in asp.net C#.


First We have to Know about IFrameThe <iframe> tag specifies an inline frame.
An inline frame is used to embed another document within the current HTML document.


Mostly Iframe does not support to show the PDF files Or Tiff Files in Google Chrome and Firefox browsers,Only supports in IE Browser.

For my Requirement in this application I want to show the PDF File in IFrame, which is in local shared folder (\\IPAddress\SharedFolder\Filename.PDF). I want to give this path to IFrame like 

<iframe id="imgdisplay" src="" runat="server">

Mostly Browser Compatibility Issues for IFrame ,see below

1. In IE Browser, If we call this path in iframe src it will displays the PDF file.

Ex: imgdisplay.attributes["src"]="\\IPAddress\SharedFolder\Filename.PDF";


2. In Firefox Browser, If we call this path in iframe src it will doesn't support to display the PDF file, It will displays the white image.

Ex: imgdisplay.attributes["src"]="\\IPAddress\SharedFolder\Filename.PDF";


3. In Google Chrome Browser, If we call this path in iframe src it will doesn't support to display the PDF file, It will displays the white image.

Ex: imgdisplay.attributes["src"]="\\IPAddress\SharedFolder\Filename.PDF";


For These Related Issues I have Created the Sample Application to Display the PDF File in IFrame.




Comments

Popular posts from this blog

Create Custom Form Control for ng-select in Angular

Configure the API gateway in Microservices Architecture with example in .NET Core

Domain Driven Design (DDD) in .NET Core

Content Negotiation in Web API with example

Send API POST Request in MS SQL Server

Restrict Special Characters in Windows Application using c#

How to Create Custom DialogBox using JQuery

HTTP and grPC Communication protocols used in Microservices

CORS (Cross-Origin Resource Sharing) in .NET