Password Property (original) (raw)

Summary

Gets or sets the password to use when loading encrypted files (PDF, DOC, DOCX, XLS, XLSX, etc).

Syntax

C#

Objective-C

C++/CLI

Java

Python

public string Password { get; set; } 
@property (nonatomic, copy, nullable) NSString *password 

public String getPassword() public void setPassword(String value)

public: property String^ Password { String^ get(); void set ( String^ ); }

Property Value

The password to use when loading encrypted files. The default value is null.

Example

using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing; using Leadtools.ImageProcessing.Color; using Leadtools.Svg; private static void DecryptPasswordExample() { /* This example loads an encrypted file using the Decrypt password event */ using (RasterCodecs codecs = new RasterCodecs()) { string srcFile = @"Encrypted.docx"; // Create a DecryptPassword handler EventHandler<CodecsDecryptPasswordEventArgs> decryptPasswordHandler = (sender, e) => { /* You can also bring up a message box informing the user that the 'e.FileName' file is encrypted and needs a password */ e.Password = "MyPassword"; /* Or you can set 'e.Cancel = true' to cancel the load */ }; // Install the DecryptPassword event handler codecs.DecryptPassword += decryptPasswordHandler; codecs.Options.Load.AllPages = true; using (RasterImage image = codecs.Load(srcFile)) { /* check that the image is not null to make sure the operation was not cancelled */ if (image != null) codecs.Save(image, srcFile + ".tif", RasterImageFormat.TifLzw, 0); } } }

Leadtools.Codecs Assembly

CompactFile(Stream,Stream,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method

CompactFile(Stream,Stream,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method

CompactFile(string,string,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method

CompactFile(string,string,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method

StartCompress(int,int,int,RasterByteOrder,RasterViewPerspective,int,byte[],int,int,CodecsCompression,CodecsCompressDataCallback) Method