L_PdfCompInit
#include "l_bitmap.h"
#include "lpdfComp.h"
L_INT EXT_FUNCTION L_PdfCompInit (phDocument, pCallback, pUserData)
LCPDF_HANDLE * phDocument; |
/* pointer to the PDF document handle */ |
pPDFCOMP_IMAGECALLBACK pCallback; |
/* optional callback function */ |
L_VOID * pUserData; |
/* pointer to user data */ |
Initializes the PDF compressor and creates an empty PDF document file in the memory.
Parameter |
Description |
phDocument |
Pointer to the PDF document handle referencing the PDF document file to create. |
pCallback |
Optional callback function; for processing each segment. Use the function pointer as the value of this parameter. |
|
If you do not provide a callback function, use NULL as the value of this parameter. |
|
If you do provide a callback function, use the function pointer as the value of this parameter. |
|
L_PdfCompInsertMRC calls this callback function to allow the user to add or cancel adding any segment to the document. The callback function must adhere to the function prototype described in pPDFCOMP_IMAGECALLBACK function. |
pUserData |
Void pointer that you can use to pass one or more additional parameters that the callback function needs. |
|
To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. |
|
If the additional parameters are not needed, you can pass NULL in this parameter. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
L_PdfCompInit must be called before calling any other PDF compressor functions.
This function also sets the callback function to be used anytime an MRC segmented bitmap is inserted or written using the L_PdfCompXXX functions.
When the handle to the PDF document is no longer needed, it should be freed by calling L_PdfCompFree. For every call to L_PdfCompInit there must be a call to L_PdfCompFree.
Required DLLs and Libraries
LCMRC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Functions: |
|
Topics: |
|
|
Example
For an example, refer to L_PdfCompInsertNormal.