L_PdfCompInit

#include "l_bitmap.h"
#include "lpdfComp.h"

L_LCMRC_API L_INT L_PdfCompInit (phDocument, pCallback, UserData)

Initializes the PDF compressor and creates an empty PDF document file in the memory.

Parameters

LCPDF_HANDLE * phDocument

Pointer to the PDF document handle referencing the PDF document file to create.

pPDFCOMP_IMAGECALLBACK 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.

HANDLE UserData

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 UserData 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

Value Meaning
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

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Mixed Raster Content (MRC) C API Help