←Select platform

AssemblyEnabled Property

Summary
Indicates whether pages can be added or removed from the PDF document.
Syntax
C#
C++/CLI
Java
Python
public bool AssemblyEnabled { get; set; } 
public boolean getAssemblyEnabled(); 
public void setAssemblyEnabled( 
   boolean booleanValue 
); 
public: 
property bool AssemblyEnabled { 
   bool get(); 
   void set (    bool ); 
} 
AssemblyEnabled # get and set (PDFSecurityOptions) 

Property Value

true to allow external viewers and editors to add or remove pages from the PDF document; otherwise, it is false. The default value is true.

Remarks

The value of AssemblyEnabled is used only when protecting a PDF file a with an owner password set in OwnerPassword.

The value of AssemblyEnabled is ignored and considered to be true if the value of the EditEnabled property is set to true.

Example
C#
using Leadtools.WinForms; 
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
 
 
/// This example will encrypt a PDF file with both a user password and an owner password and restrict printing. 
 
public void PDFFileSecurityOptionsExample() 
{ 
   string sourceFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); 
   string destinationFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD_EncryptedNoPrint.pdf"); 
 
   PDFFile pdfFile = new PDFFile(sourceFileName); 
 
   // Set the security options 
   pdfFile.SecurityOptions = new PDFSecurityOptions(); 
   pdfFile.SecurityOptions.UserPassword = "LEAD"; 
   pdfFile.SecurityOptions.OwnerPassword = "LEAD_SECRET"; 
   pdfFile.SecurityOptions.PrintEnabled = false; 
   pdfFile.SecurityOptions.HighQualityPrintEnabled = false; 
   pdfFile.SecurityOptions.EncryptionMode = PDFEncryptionMode.RC128Bit; 
 
   // Encrypt the file by saving it to the destination file 
   pdfFile.Convert(1, -1, destinationFileName); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.7.10
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.