Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<asp:Panel ID="pnlDisplay" runat="server" Visible="true" Width="100%">
   <iframe width="700px" runat="server" height="800px" id="myPDF"></iframe>
</asp:Panel>

C#
protected void grdArticles_RowCommand(object sender, GridViewCommandEventArgs e)
{
   if (e.CommandName == "View")
   {
      DataSet ds = obj.getArticlebyId(Convert.ToInt32(e.CommandArgument));
      if (ds.Tables[0].Rows.Count > 0)
      {
         lblTitle.Text = ds.Tables[0].Rows[0]["ArticleTitle"].ToString();
         lblAritcalContent.Text = ds.Tables[0].Rows[0]["ArticleContent"].ToString();
         string pdffile = ds.Tables[0].Rows[0]["PdfPath"].ToString();
         //string pdf1 = "PdfArtical/" + "Test.pdf" + "#toolbar=0&navpanes=0";
         string pdf1 = pdffile;
         myPDF.Attributes.Add("src", pdf1.ToString());
         //myPDF.Style.Add("display", "none");
      }
      else
      {
      }
   }
}

From Here I want to restrict download and print Option Please help me..
Posted
Updated 11-Sep-13 22:11pm
v2

1 solution

You cannot control this functionality in browser.
One way is to generate image from pdf file and display in browser but this is same as showing PDF because user can download images. Even if you able to control this user can take screen shots and save on harddisk.

You can try this control ASP.NET PDF Viewer User Control Without Acrobat Reader Installed on Client or Server[^].
 
Share this answer
 

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



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