iText 8.0.2 API
iText.Kernel.Pdf.PdfEncryptor Class Reference

This class takes any PDF and returns exactly the same but encrypted. More...

Public Member Functions

iText.Kernel.Pdf.PdfEncryptor  SetEventCountingMetaInfo (IMetaInfo metaInfo)
  Sets the iText.Commons.Actions.Contexts.IMetaInfo that will be used during PdfDocument creation. More...
 
iText.Kernel.Pdf.PdfEncryptor  SetEncryptionProperties (EncryptionProperties properties)
  Sets the EncryptionProperties More...
 
void  Encrypt (PdfReader reader, Stream os, IDictionary< String, String > newInfo)
  Entry point to encrypt a PDF document. More...
 
void  Encrypt (PdfReader reader, Stream os)
  Entry point to encrypt a PDF document. More...
 

Static Public Member Functions

static void  Encrypt (PdfReader reader, Stream os, EncryptionProperties properties, IDictionary< String, String > newInfo)
  Entry point to encrypt a PDF document. More...
 
static void  Encrypt (PdfReader reader, Stream os, EncryptionProperties properties)
  Entry point to encrypt a PDF document. More...
 
static String  GetPermissionsVerbose (int permissions)
  Give you a verbose analysis of the permissions. More...
 
static bool  IsPrintingAllowed (int permissions)
  Tells you if printing is allowed. More...
 
static bool  IsModifyContentsAllowed (int permissions)
  Tells you if modifying content is allowed. More...
 
static bool  IsCopyAllowed (int permissions)
  Tells you if copying is allowed. More...
 
static bool  IsModifyAnnotationsAllowed (int permissions)
  Tells you if modifying annotations is allowed. More...
 
static bool  IsFillInAllowed (int permissions)
  Tells you if filling in fields is allowed. More...
 
static bool  IsScreenReadersAllowed (int permissions)
  Tells you if repurposing for screenreaders is allowed. More...
 
static bool  IsAssemblyAllowed (int permissions)
  Tells you if document assembly is allowed. More...
 
static bool  IsDegradedPrintingAllowed (int permissions)
  Tells you if degraded printing is allowed. More...
 

Detailed Description

This class takes any PDF and returns exactly the same but encrypted.

This class takes any PDF and returns exactly the same but encrypted. All the content, links, outlines, etc, are kept. It is also possible to change the info dictionary.

Member Function Documentation

◆ Encrypt() [1/4]

void iText.Kernel.Pdf.PdfEncryptor.Encrypt ( PdfReader  reader,
Stream  os 
)
inline

Entry point to encrypt a PDF document.

Parameters
reader the read PDF
os the output destination

◆ Encrypt() [2/4]

static void iText.Kernel.Pdf.PdfEncryptor.Encrypt ( PdfReader  reader,
Stream  os,
EncryptionProperties  properties 
)
inlinestatic

Entry point to encrypt a PDF document.

Parameters
reader the read PDF
os the output destination
properties encryption properties. See EncryptionProperties.

◆ Encrypt() [3/4]

static void iText.Kernel.Pdf.PdfEncryptor.Encrypt ( PdfReader  reader,
Stream  os,
EncryptionProperties  properties,
IDictionary< String, String >  newInfo 
)
inlinestatic

Entry point to encrypt a PDF document.

Parameters
reader the read PDF
os the output destination
properties encryption properties. See EncryptionProperties.
newInfo an optional String map to add or change the info dictionary. Entries with null values delete the key in the original info dictionary

◆ Encrypt() [4/4]

void iText.Kernel.Pdf.PdfEncryptor.Encrypt ( PdfReader  reader,
Stream  os,
IDictionary< String, String >  newInfo 
)
inline

Entry point to encrypt a PDF document.

Parameters
reader the read PDF
os the output destination
newInfo an optional String map to add or change the info dictionary. Entries with null values delete the key in the original info dictionary

◆ GetPermissionsVerbose()

static String iText.Kernel.Pdf.PdfEncryptor.GetPermissionsVerbose ( int  permissions )
inlinestatic

Give you a verbose analysis of the permissions.

Parameters
permissions the permissions value of a PDF file
Returns
a String that explains the meaning of the permissions value

◆ IsAssemblyAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsAssemblyAllowed ( int  permissions )
inlinestatic

Tells you if document assembly is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if document assembly is allowed

◆ IsCopyAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsCopyAllowed ( int  permissions )
inlinestatic

Tells you if copying is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if copying is allowed

◆ IsDegradedPrintingAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsDegradedPrintingAllowed ( int  permissions )
inlinestatic

Tells you if degraded printing is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if degraded printing is allowed

◆ IsFillInAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsFillInAllowed ( int  permissions )
inlinestatic

Tells you if filling in fields is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if filling in fields is allowed

◆ IsModifyAnnotationsAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsModifyAnnotationsAllowed ( int  permissions )
inlinestatic

Tells you if modifying annotations is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if modifying annotations is allowed

◆ IsModifyContentsAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsModifyContentsAllowed ( int  permissions )
inlinestatic

Tells you if modifying content is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if modifying content is allowed

◆ IsPrintingAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsPrintingAllowed ( int  permissions )
inlinestatic

Tells you if printing is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if printing is allowed

◆ IsScreenReadersAllowed()

static bool iText.Kernel.Pdf.PdfEncryptor.IsScreenReadersAllowed ( int  permissions )
inlinestatic

Tells you if repurposing for screenreaders is allowed.

Parameters
permissions the permissions value of a PDF file
Returns
true if repurposing for screenreaders is allowed

◆ SetEncryptionProperties()

iText.Kernel.Pdf.PdfEncryptor iText.Kernel.Pdf.PdfEncryptor.SetEncryptionProperties ( EncryptionProperties  properties )
inline

Sets the EncryptionProperties

Parameters
properties the properties to set
Returns
this PdfEncryptor instance

◆ SetEventCountingMetaInfo()

iText.Kernel.Pdf.PdfEncryptor iText.Kernel.Pdf.PdfEncryptor.SetEventCountingMetaInfo ( IMetaInfo  metaInfo )
inline

Sets the iText.Commons.Actions.Contexts.IMetaInfo that will be used during PdfDocument creation.

Parameters
metaInfo meta info to set
Returns
this PdfEncryptor instance