Aspose.Slides.Examples.CSharp.Presentations.Conversion.ConvertPresentationToPasswordProtectedPDF.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Conversion();

            // Instantiate a Presentation object that represents a presentation file
            using (Presentation presentation = new Presentation(dataDir + "DemoFile.pptx"))
            {
                // Instantiate the PdfOptions class
                PdfOptions pdfOptions = new PdfOptions();

                // Setting PDF password
                pdfOptions.Password = "password";

                // Save the presentation to password protected PDF
                presentation.Save(dataDir + "PasswordProtectedPDF_out.pdf", SaveFormat.Pdf, pdfOptions);
            }
        }
    }
ConvertPresentationToPasswordProtectedPDF