10 Replies Latest reply on Oct 17, 2008 5:20 AM by Patrick Leckey

    Open password protected PDF in website

    Level 1

      I hope someone can help me. Greatly appreciate it.

      My website has PDF documents that's available for registered users to view online (through my site) only.

      Currently, I can't find any solutions to prevent users from downloading/"save-as" the PDF doc in their local drives, so I'm thinking of password-protecting these PDFs. This will ensure that they'd not be able to view the PDFs even though they download it and save-as local.

      However, how do I open these password-protected PDFs on my site?
      When I point/redirect to these PDFs, it will prompt for password.

      It'd defeat all protection intent if I were to give the password to the user to enter, right?

      1. Response.Redirect("mySecuredPdf.pdf")
      2. The browser will then prompt user for password.

      What can I do in the CodeBehind to enable the server to OPEN the pdf, and at the same time, pass the correct password to the viewer to open without prompting?

      I cannot remove password, because I want to prevent users from downloading and then opening it later, or redistributing the file.

      btw, i'm using ASP.NET.

      Please help.