You must Sign In to post a response.
  • Category: ASP.NET

    How to open the pdf file in

    how to open the pdf file in but user can just view that file not save and download.
  • #764210
    Hi Vinod.

    Try below piece of code.

    FileAttributes obj = File.GetAttributes(path);
    File.SetAttributes(path, obj | FileAttributes.ReadOnly);

    Refer below msdn article for more information regarding file attributes.

    Sridhar Thota.
    Editor: DNS Forum.

  • #764231
    There is no inbuilt viewer for PDF file exist in ASP.NET, you can open it with its native application.
    I mean if user has PDF Acrobat exist and if it open PDF file then bydefault it will open in Acrobat and can be editable, but if user has only Acrobat Reader installed then it can open in view mode.
    You just need to use Hyperlink or Linkbutton control to set 'NavigateURL' to PDF file and it will get open

    Hope it helps

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #764386
    It will be impossible. Cause to view pdf you need pdf viewer embedded in browser. Then when it loads the pdf it also can write or save the file to disk.
    If you are unable to do something properly for the first time, call it Version 1.0!

    Thanks & Regards,

  • #764606
    To view pdf file in ASP.NET, you can add a pdfviewer control.
    refer to this article:

  • #764672
    You'll need a PDF viewer control if you wish to view PDF files in your website. I found these topics which may be helpful:

  • Sign In to post your comments