L_PdfCompInit

Summary

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

Syntax

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

L_LCMRC_API L_INT L_PdfCompInit (phDocument, pCallback, pUserData)

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.

L_VOID *pUserData

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.

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

See Also

Functions

Topics

Example

For an example, refer to L_PdfCompInsertNormal.

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

LEADTOOLS Mixed Raster Content (MRC) C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.