Provides options for loading any encrypted file.
public CodecsDecryptOptions Decrypt { get; }
@property (nonatomic, assign) LTCodecsDecryptOptions Decrypt
public CodecsDecryptOptions getDecrypt()
public:
property CodecsDecryptOptions Decrypt {
bool get();
}
Decrypt # get (CodecsLoadOptions)
Class containing password values used to decrypt files.
Provide the password for decrypting files using this property or through the RasterCodecs.DecryptPassword event.
The RasterCodecs.Pdf.Load.Password property can also be used for loading encrypted PDF files.
The difference is that RasterCodecs.Decrypt.Password can be used for decrypting any files, whereas RasterCodecs.Pdf.Load.Password can be used to only decrypt PDF files.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
using Leadtools.Pdf;
public void CodecsLoadOptionsDecrypt_Example()
{
/* This sample loads Encrypted.docx, which is encrypted with the password 'MyPassword' */
using (RasterCodecs codecs = new RasterCodecs())
{
string srcFile = @"Encrypted.docx";
codecs.Options.Load.Decrypt.Password = "MyPassword";
codecs.Options.Load.AllPages = true;
using (RasterImage image = codecs.Load(srcFile))
{
codecs.Save(image, srcFile + ".tif", RasterImageFormat.TifLzw, 0);
}
}
}
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import org.junit.*;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import static org.junit.Assert.*;
import leadtools.*;
import leadtools.codecs.*;
import leadtools.imageprocessing.core.MinMaxBitsCommand;
public void codecsLoadOptionsDecryptExample() {
final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images";
String srcFile = combine(LEAD_VARS_IMAGES_DIR, "Encrypted.pdf");
RasterCodecs codecs = new RasterCodecs();
codecs.getOptions().getLoad().getDecrypt().setPassword("MyPassword");
codecs.getOptions().getLoad().setAllPages(true);
RasterImage image = codecs.load(srcFile);
codecs.save(image, srcFile + ".tif", RasterImageFormat.TIFLZW, 0);
assertTrue("File unsuccessfully saved to " + srcFile + ".tif", (new File(srcFile + ".tif")).exists());
System.out.printf("File successfully saved to %s%n", srcFile + ".tif");
image.dispose();;
codecs.dispose();;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document