Click or drag to resize

PdfiumFPDF_GetEncryptDictionary Method

Get document’s encryption dictionary.

Namespace: Patagames.Pdf
Assembly: Patagames.Pdf (in Patagames.Pdf.dll) Version: 4.94.2704
Syntax
public static IntPtr FPDF_GetEncryptDictionary(
	IntPtr document
)

Parameters

document  IntPtr
Handle to document. Returned by FPDF_LoadDocument(String, String) function.

Return Value

IntPtr
Handle to the PDF dictionary
Remarks
A PDF document can be encrypted (PDF 1.1) to protect its contents from unauthorized access. Encryption applies to all strings and streams in the document’s PDF file, but not to other object types such as integers and boolean values, which are used primarily to convey information about the document’s structure rather than its content. Leaving these values unencrypted allows random access to the objects within a document, whereas encrypting the strings and streams protects the document’s substantive contents.
Note  Note
When a PDF stream object refers to an external file, the stream’s contents are not encrypted, since they are not part of the PDF file itself. However, if the contents of the stream are embedded within the PDF file, they are encrypted like any other stream in the file. Beginning with PDF 1.5, embedded files may be encrypted in an otherwise unencrypted document.

Encryption-related information is stored in a document’s encryption dictionary, which is the value of the Encrypt entry in the document’s trailer dictionary. The absence of this entry from the trailer dictionary means that the document is not encrypted.

The encryption dictionary’s Filter entry identifies the file’s security handler, a software module that implements various aspects of the encryption process and controls access to the contents of the encrypted document. PDF specifies a standard password-based security handler that all consumer applications are expected to support, but applications may optionally provide security handlers of their own.

The SubFilter entry specifies the syntax of the encryption dictionary contents. It allows interoperability between handlers; that is, a document may be decrypted by a handler other than the preferred one (the Filter entry) if they both support the format specified by SubFilter.

The V entry, in specifying which algorithm to use, determines the length of the encryption key, on which the encryption(and decryption) of data in a PDF file is based.For V values 2 and 3, the Length entry specifies the exact length of the encryption key. In PDF 1.5, a value of 4 for V permits the security handler to use its own encryption and decryption algorithms and to specify crypt filters to use on specific streams.

See Also