#1
Posted
:
Friday, July 7, 2017 4:59:17 PM(UTC)
Groups: Registered
Posts: 119
Was thanked: 4 time(s) in 4 post(s)
There are many times when you want to keep information within a PDF private from others and within the LEADTOOLS SDK you can add PDF Security Options to your document to keep information hidden from others. Below you will a small code snippet that add these security options to a PDF File.
Code:
//Load PDF File
PDFFile pdfFile = new PDFFile(fileName);
// Set the security options
pdfFile.SecurityOptions = new PDFSecurityOptions();
pdfFile.SecurityOptions.UserPassword = "PASSWORD";
pdfFile.SecurityOptions.PrintEnabled = false;
pdfFile.SecurityOptions.CopyEnabled = 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);
Now when this file is attempted to be opened, it will ask for a password first. You can view more information on the PDFSecurityOptions Class here:
https://www.leadtools.co.../pdfsecurityoptions.htmlNick 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.