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

Angular CLI Commands - Cheat Sheet

Difference of High-Level Design (HLD) and Low-Level Design (LLD)

Restrict Special Characters in Windows Application using c#

Naming Conventions

Restrict Special Characters Using JavaScript By Copy,Paste

Create a function to convert from string to Decimal using JavaScript

How to Create Custom DialogBox using JQuery

CORS (Cross-Origin Resource Sharing) in .NET

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

Create Custom Form Control for ng-select in Angular