Encrypt an existing PDF file

7 posts, 0 answers
  1. Salman Fazal
    Salman Fazal avatar
    1 posts
    Member since:
    Dec 2009

    Posted 14 Feb 2016 Link to this post

    How can i encypt an existing PDF file? I just want to set the password on it.
  2. Tanya
    Admin
    Tanya avatar
    764 posts

    Posted 17 Feb 2016 Link to this post

    Hi,

    I replied to the support thread on the same topic, but will post my answer here as well in case anyone else have the same question:

    "You could protect a document through the ExportSettings of PdfFormatProvider. More details on how this could be achieved are available in our online documentation."

    Regards,
    Tanya
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Cheryl
    Cheryl avatar
    20 posts
    Member since:
    May 2013

    Posted 11 Sep 2016 Link to this post

    Hello, is there a way to set an Owner Password to an existing PDF, so that the PDF can be viewed without a password but not edited?

    We're using Telerik Reporting to generate a report and save as a PDF.  We need to be able to lock down editing and as Telerik Reporting doesn't appear to allow for this, we are wondering whether we can import the already created PDF using PDFProcessing so that we can apply a password to it.

    We don't want to use a third party component if we can help it.

    Any help greatly appreciated.

    Cheryl

     

  4. Tanya
    Admin
    Tanya avatar
    764 posts

    Posted 14 Sep 2016 Link to this post

    Hello Cheryl,

    The settings of PdfFormatProvider allow you to protect the document with a password or to encrypt it. I added a feature request for the functionality you need to our feedback portal where you can vote and track the progress of the task.

    Regards,
    Tanya
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  5. Muhammad
    Muhammad avatar
    9 posts
    Member since:
    Nov 2013

    Posted 19 Jul 2018 Link to this post

    HI Admin,

    we are exporting PDF by using below code with Telerik control version 2014.1.331.40. we are unable to find the password property (settings.UserPassword = "D0cum3ntP4ssw0rd") in PdfExportSettings  class object as shown below. Please guide us regarding the prerequisite of using PdfExportSettings password functionality. Is there any other version of controls or any DLL is required

    <div style=" background-color: #fff;"><span style=" "><span style=" margin-left: 0px !important;"><code style="color: #000;"><</code><code style="color: #069;font-weight: bold;">p</code><code style="color: #000;">>PdfExportSettings settings = new PdfExportSettings();</code></span></span></div><div style=" background-color: #F8F8F8;"><span style=" "><span style=" margin-left: 0px !important;"><code style="color: #000;"></</code><code style="color: #069;font-weight: bold;">p</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">p</code><code style="color: #000;">></</code><code style="color: #069;font-weight: bold;">p</code><code style="color: #000;">><</code><code style="color: #069;font-weight: bold;">p</code><code style="color: #000;">>private void ExportIntoStream()<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>        {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            try<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                RadDocument radDocument = (new XamlFormatProvider()).Import(this.DocumentXaml);<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                (new PdfFormatProvider()).Export(radDocument, this.output);<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            }<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            catch (Exception exception)<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            {<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>                throw exception;<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>            }<</code><code style="color: #069;font-weight: bold;">br</code><code style="color: #000;">>        }</</code><code style="color: #069;font-weight: bold;">p</code><code style="color: #000;">></code></span></span></div>
  6. Muhammad
    Muhammad avatar
    9 posts
    Member since:
    Nov 2013

    Posted 19 Jul 2018 in reply to Muhammad Link to this post

    HI Admin,
    we are exporting PDF by using below code with Telerik control version 2014.1.331.40. we are unable to find the password property (settings.UserPassword = "D0cum3ntP4ssw0rd") in PdfExportSettings  class object as shown below. Please guide us regarding the prerequisite of using PdfExportSettings password functionality. Is there any other version of controls or any DLL is required

    PdfExportSettings settings = new PdfExportSettings();
    private void ExportIntoStream()
     {
    try
      
    RadDocument radDocument = (new XamlFormatProvider()).Import(this.DocumentXaml);
      
    (new PdfFormatProvider()).Export(radDocument, this.output);
     
    catch (Exception exception)
     throw exception;}}
  7. Tanya
    Admin
    Tanya avatar
    764 posts

    Posted 24 Jul 2018 Link to this post

    Hello Muhammad,

    From the snippet you shared, it seems like you are using the API of RadRichTextBox. If so, the control currently doesn't support protecting PDF documents with a password and we have logged a feature request to add this functionality on our public portal. You can vote for the implementation as well as track the status of the task using this feedback item.

    The PdfExportSettings class is part of the PdfProcessing library, from the Telerik Document Processing package. You could use it to import the generated from RadRichTextBox PDF document and apply it a password. Please, note that this library is released with Q2 2014 and you will need to get a newer version of the controls to use it.

    Hope this helps.

    Regards,
    Tanya
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top