Initializes the PDF compressor and creates an empty PDF document file in the memory.
#include "l_bitmap.h"
#include "lpdfComp.h"
L_LCMRC_API L_INT L_PdfCompInit (phDocument, pCallback, pUserData)
Pointer to the PDF document handle referencing the PDF document file to create.
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.
Handle 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 Handle. 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.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
For an example, refer to L_PdfCompInsertNormal.