XFINIUM.PDF Documentation
EncryptFile(Stream,String,Stream,PdfSecurityHandler,Boolean) Method



Xfinium.Pdf.Utilities Namespace > PdfEncryptor Class > EncryptFile Method : EncryptFile(Stream,String,Stream,PdfSecurityHandler,Boolean) Method
Stream containing the input PDF file.
Password for the input file if it is encrypted, othewise null.
Stream for storing the encrypted PDF file.
The security handler used for encryption.
If true then the internal structure of the output PDF file is compressed.
Encrypts the PDF file given in input stream and saves the encrypted file to output stream.
Syntax
'Declaration
 
Public Overloads Shared Sub EncryptFile( _
   ByVal input As Stream, _
   ByVal inputPassword As String, _
   ByVal output As Stream, _
   ByVal securityHandler As PdfSecurityHandler, _
   Optional ByVal enableObjectCompression As Boolean _
) 
'Usage
 
Dim input As Stream
Dim inputPassword As String
Dim output As Stream
Dim securityHandler As PdfSecurityHandler
Dim enableObjectCompression As Boolean
 
PdfEncryptor.EncryptFile(input, inputPassword, output, securityHandler, enableObjectCompression)

Parameters

input
Stream containing the input PDF file.
inputPassword
Password for the input file if it is encrypted, othewise null.
output
Stream for storing the encrypted PDF file.
securityHandler
The security handler used for encryption.
enableObjectCompression
If true then the internal structure of the output PDF file is compressed.
Requirements

Supported .NET Platforms: .NET 4.0 and higher, Windows Forms, ASP.NET, Windows Presentation Foundation 4.x, Silverlight 5, WinRT, Universal Windows Platform, Xamarin Mac, iOS & Android, Portable Class Library, .NET Core, .NET Standard


Target Platforms:Windows 10, Windows 8.1, Windows 8 , Windows 7, Windows Vista SP1 or later, Windows Server 2008, Windows Server 2008 R2

See Also

Reference

PdfEncryptor Class
PdfEncryptor Members
Overload List