Sumit Kumar
Sumit Kumar

Reputation: 51

how to open pdf into pdf viewer in asp.net

I have a pdf book i want to open this pdf in pdf viewer on the browser in asp.net like "http://wdn.ipublishcentral.net/informatics/viewinside/40590590200230" Would you suggest me?

Upvotes: 4

Views: 8363

Answers (1)

Freelancer
Freelancer

Reputation: 9074

<iframe> tag is used for this.

Try using this tag as like following:

 <iframe src="anyfilename.PDF" width="810px" height="700px" scrolling="no" frameborder="0">
</iframe>

If you are using telerik controls as like the link you provided then use following>>

<radPdf:PdfWebControl id="PdfWebControl1" runat="server" height="600px" width="100%" />

and codebehind>>

if (!IsPostBack) 
        {
            //Get PDF as byte array from file (or database, browser upload, remote storage, etc)
            byte[] pdfData = System.IO.File.ReadAllBytes(@"C:\demo.pdf");

            //Load PDF byte array into RAD PDF
            this.PdfWebControl1.CreateDocument("Document Name", pdfData);
        }

Hope its helpful!!!

Upvotes: 2

Related Questions