#1
Posted
:
Friday, December 1, 2017 5:56:14 PM(UTC)
Groups: Registered
Posts: 119
Was thanked: 4 time(s) in 4 post(s)
Sometimes you may receive a PDF that you wish to view within a LEADTOOLS viewer but the PDF is locked, or contains a password to view it. Within the RasterCodecs Class, there is an Options Property that gets or sets the load and save options for the RasterCodecs. These options are categorized into groups corresponding to the image format they are applied to.
If you want to programmatically unlock the PDF then you will need to use the PDF Password options. See below for a simple code snippet on how you can unlock the PDF, then resave it without the password.
Code:using (RasterCodecs codecs = new RasterCodecs())
{
codecs.Options.Pdf.Load.Password = "PASSWORD OF THE PDF";
RasterImage image = codecs.Load(@"Password.pdf");
codecs.Save(image, @"NoPassword.pdf", RasterImageFormat.RasPdf, 0);
}
Nick Villalobos
Developer Support Engineer
LEAD Technologies, Inc.
![LEAD Logo LEAD Logo](https://www.leadtools.com/images/new-site-images/leadtools-logo-header.png)
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.