PDFix SDK  6.12.0
Callbacks

PDFix SDK Callbacks. More...

Typedefs

typedef int(* PdfCancelProc) (void *client_data)
 PdfCancelProc. More...
 
typedef void(* PdfEventProc) (void *client_data)
 PdfEventProc. More...
 
typedef unsigned long(* PdfDigestDataProc) (int buffer_count, const unsigned char *buffer_to_sign[], unsigned long buffer_size[], unsigned char *sign_buff, unsigned long sign_buff_size, void *client_data)
 PdfDigestDataProc. More...
 
typedef int(* PsStreamReadProc) (int offset, void *buffer, int size, void *client_data)
 
typedef int(* PsStreamWriteProc) (int offset, void *buffer, int size, void *client_data)
 
typedef void(* PsStreamDestroyProc) (void *client_data)
 Called at end of stream so you can do clean up and free allocated memory. More...
 
typedef int(* PsStreamGetSizeProc) (void *client_data)
 
typedef int(* PsStreamGetPosProc) (void *client_data)
 This is called to get the current position. More...
 
typedef void(* PdfSecurityDestroyProc) (void *client_data)
 This is called when security handler is destroyed. More...
 
typedef bool(* PdfSecuritySetAuthorizationDataProc) (void *data, void *client_data)
 This is called when PdfCustomSecurityHandler::SetAuthorizationData procedure is executed. More...
 
typedef bool(* PdfSecurityOnInitProc) (const PdsDictionary *trailer, void *client_data)
 This is called when the document is authorized. More...
 
typedef int(* PdfSecurityGetPermissionsProc) (void *client_data)
 This is called to get the permissions set to the current document. More...
 
typedef bool(* PdfSecurityIsMetadataEncryptedProc) (void *client_data)
 This is called to get whether to encrypt metadata dictionary or not. More...
 
typedef void(* PdfSecurityUpdateEncryptDictProc) (PdsDictionary *encrypt_dict, const PdsArray *id_array, void *client_data)
 This is called on document save when encryption dictionary is filled or just updated. More...
 
typedef int(* PdfSecurityGetDecryptSizeProc) (const void *data, int size, void *client_data)
 This is called to get the size of decrypted data. More...
 
typedef int(* PdfSecurityDecryptContentProc) (int objnum, int gennum, const void *data, int data_size, void *dest, int dest_size, void *client_data)
 This is called to decrypt the data. More...
 
typedef int(* PdfSecurityGetEncryptSizeProc) (const void *data, int size, void *client_data)
 This is called to get the size of encrypted data. More...
 
typedef int(* PdfSecurityEncryptContentProc) (int objnum, int gennum, const void *data, int data_size, void *dest, int dest_size, void *client_data)
 This is called to encryp the data. More...
 
typedef bool(* PdfGetAuthDataProc) (PdfDoc *doc, PdfSecurityHandler *handler, void *data)
 This is called to get the authorization data and set it to the handler. More...
 
typedef PdfSecurityHandler *(* PdfSecurityCreateHandlerProc) (void *client_data)
 This is called when the document is authozied to create registered security handler. More...
 

Detailed Description

PDFix SDK Callbacks.

Typedef Documentation

◆ PdfCancelProc

typedef int(* PdfCancelProc) (void *client_data)

PdfCancelProc.

\proc_type the name of procedure currently executed. \proc_progress the name of procedure currently executed.

Parameters
client_dataPointer to user-supplied data to pass to PdfCancelProc each time it is called.
Returns
true if process should be cancelled, false otherwise.

◆ PdfDigestDataProc

typedef unsigned long(* PdfDigestDataProc) (int buffer_count, const unsigned char *buffer_to_sign[], unsigned long buffer_size[], unsigned char *sign_buff, unsigned long sign_buff_size, void *client_data)

PdfDigestDataProc.

Parameters
buffer_count
buffer_to_sign
buffer_size
sign_buff(filled by method) If the buffer is null function returns required length of the buffer.
sign_buff_sizeLength of a signed buffer.
client_dataPointer to user-supplied data to pass to PdfDigestDataProc each time it is called.
Returns
Required lenght.
See also
PdfCustomDigSig::RegisterDigestDataLenProc

◆ PdfEventProc

typedef void(* PdfEventProc) (void *client_data)

PdfEventProc.

Parameters
client_dataPointer to user-supplied data to pass to PdfEventProc each time it is called.
See also
Pdfix::RegisterEvent

◆ PdfGetAuthDataProc

typedef bool(* PdfGetAuthDataProc) (PdfDoc *doc, PdfSecurityHandler *handler, void *data)

This is called to get the authorization data and set it to the handler.

Parameters
doccurrent pdf document
handlersecurity handler
dataUser-supplied data.
Returns
true if data aquisition was successfull, false otherwise

◆ PdfSecurityCreateHandlerProc

typedef PdfSecurityHandler*(* PdfSecurityCreateHandlerProc) (void *client_data)

This is called when the document is authozied to create registered security handler.

Parameters
client_dataUser-supplied data that was passed.
Returns
new instance security handler

◆ PdfSecurityDecryptContentProc

typedef int(* PdfSecurityDecryptContentProc) (int objnum, int gennum, const void *data, int data_size, void *dest, int dest_size, void *client_data)

This is called to decrypt the data.

Parameters
objnumObject number
gennumGeneration number
datadata to decrypt
data_sizesize ot the data to decrypt
destoutput data
dest_sizesize of the output data
client_dataUser-supplied data that was passed.
Returns
size of the decrypted data

◆ PdfSecurityDestroyProc

typedef void(* PdfSecurityDestroyProc) (void *client_data)

This is called when security handler is destroyed.

Parameters
client_dataUser-supplied data that was passed.

◆ PdfSecurityEncryptContentProc

typedef int(* PdfSecurityEncryptContentProc) (int objnum, int gennum, const void *data, int data_size, void *dest, int dest_size, void *client_data)

This is called to encryp the data.

Parameters
objnumObject number
gennumGeneration number
datadata to encrypt
data_sizesize ot the data to encrypt
destoutput data
dest_sizesize of the output data
client_dataUser-supplied data that was passed.
Returns
size of the encrypted data

◆ PdfSecurityGetDecryptSizeProc

typedef int(* PdfSecurityGetDecryptSizeProc) (const void *data, int size, void *client_data)

This is called to get the size of decrypted data.

Parameters
datadata to decrypt
sizesize of the data
client_dataUser-supplied data that was passed.
Returns
size of the decrypted data

◆ PdfSecurityGetEncryptSizeProc

typedef int(* PdfSecurityGetEncryptSizeProc) (const void *data, int size, void *client_data)

This is called to get the size of encrypted data.

Parameters
datadata to encrypt
sizesize of the data
client_dataUser-supplied data that was passed.
Returns
size of the encrypted data

◆ PdfSecurityGetPermissionsProc

typedef int(* PdfSecurityGetPermissionsProc) (void *client_data)

This is called to get the permissions set to the current document.

Parameters
client_dataUser-supplied data that was passed.
Returns
permission flags

◆ PdfSecurityIsMetadataEncryptedProc

typedef bool(* PdfSecurityIsMetadataEncryptedProc) (void *client_data)

This is called to get whether to encrypt metadata dictionary or not.

Parameters
client_dataUser-supplied data that was passed.
Returns
if metadata will be encrypted

◆ PdfSecurityOnInitProc

typedef bool(* PdfSecurityOnInitProc) (const PdsDictionary *trailer, void *client_data)

This is called when the document is authorized.

Parameters
trailerdocument trailer dictionary
client_dataUser-supplied data that was passed.
Returns
initialization procedure was successfull

◆ PdfSecuritySetAuthorizationDataProc

typedef bool(* PdfSecuritySetAuthorizationDataProc) (void *data, void *client_data)

This is called when PdfCustomSecurityHandler::SetAuthorizationData procedure is executed.

Parameters
datacurrent pdf document
client_dataUser-supplied data that was passed.
Returns
procedure was successfull

◆ PdfSecurityUpdateEncryptDictProc

typedef void(* PdfSecurityUpdateEncryptDictProc) (PdsDictionary *encrypt_dict, const PdsArray *id_array, void *client_data)

This is called on document save when encryption dictionary is filled or just updated.

Parameters
encrypt_dictraw pointer to document's encryption dictionary
id_arrayraw pointer to document's ID array
client_dataUser-supplied data that was passed.

◆ PsStreamDestroyProc

typedef void(* PsStreamDestroyProc) (void *client_data)

Called at end of stream so you can do clean up and free allocated memory.

Parameters
client_dataUser-supplied data that was passed.

◆ PsStreamGetPosProc

typedef int(* PsStreamGetPosProc) (void *client_data)

This is called to get the current position.

Parameters
client_dataUser-supplied data that was passed.
Returns
The size of the stream in bytes.

◆ PsStreamGetSizeProc

typedef int(* PsStreamGetSizeProc) (void *client_data)

This is called to get the length of the stream, which may be NULL if the stream cannot be set to a new position. PsStreamSeekProc() and PsStreamGetLength() must be provided together.

Parameters
client_dataUser-supplied data that was passed.
Returns
The size of the stream in bytes.

◆ PsStreamReadProc

typedef int(* PsStreamReadProc) (int offset, void *buffer, int size, void *client_data)

Called by the PsStream object for Read operation. This procedure must return the number of bytes specified by size, obtaining them in any way it wishes. If your procedure reads data from a file, it is generally quite inefficient to open the file, read the bytes, then close the file each time bytes are requested. Instead, consider opening the file the first time bytes are requested from it, reading the entire file into a secondary buffer, and closing the file.When subsequent requests for data from the file are received, simply copy data from the secondary buffer, rather than re - opening the file.

Parameters
bufferBuffer into which your procedure must place the number of bytes specified by size.
offsetThe seek position.
sizeThe size of data in bytes.
client_dataUser-supplied data that was passed.
Returns
The number of bytes actually read or written.

◆ PsStreamWriteProc

typedef int(* PsStreamWriteProc) (int offset, void *buffer, int size, void *client_data)

Called by the PsStream object for Write operation. This procedure must return the number of bytes specified by size, obtaining them in any way it wishes. If your procedure reads data from a file, it is generally quite inefficient to open the file, read the bytes, then close the file each time bytes are requested. Instead, consider opening the file the first time bytes are requested from it, reading the entire file into a secondary buffer, and closing the file.When subsequent requests for data from the file are received, simply copy data from the secondary buffer, rather than re - opening the file.

Parameters
bufferBuffer which your procedure must place the number of bytes specified by size.
offsetThe seek position.
sizeThe size of data in bytes.
client_dataUser-supplied data that was passed.
Returns
The number of bytes actually read or written.