L_PdfCompInsertNormal (original) (raw)
Summary
Compresses the specified image, without segmenting it, and inserts the image in the PDF file in memory.
Syntax
#include "l_bitmap.h"
#include "lpdfComp.h"
L_LCMRC_API L_INT L_PdfCompInsertNormal(hDocHandle, pBitmap)
Parameters
LCPDF_HANDLE hDocHandle
Handle to an existing PDF document. This handle is obtained by calling the L_PdfCompInit function.
pBITMAPHANDLE pBitmap
Pointer to the bitmap handle that references the image to be inserted in the PDF document.
Returns
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Comments
To segment an image using MRC segmentation, compress it, and insert the bitmap to the PDF file in memory, call L_PdfCompInsertMRC.
Required DLLs and Libraries
- LCMRC
- LCPDF
- LCENC
- LCZIB
- LTSGM
- 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
This example inserts an image to pdf document without using the MRC.
L_INT PdfCompInsertNormalExample(L_VOID)
{
L_INT nRet;
BITMAPHANDLE hBitmap;
LCPDF_HANDLE hDocument;
nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("Image1.CMP")), &hBitmap,sizeof(BITMAPHANDLE),0,ORDER_RGB,NULL,NULL);
if(nRet != SUCCESS)
{
return nRet;
}
nRet = L_PdfCompInit (&hDocument,NULL,NULL);
if(nRet != SUCCESS)
{
return nRet;
}
nRet = L_PdfCompInsertNormal(hDocument,&hBitmap);
if(nRet != SUCCESS)
{
L_PdfCompFree (hDocument);
return nRet;
}
nRet = L_PdfCompWrite (hDocument,MAKE_IMAGE_PATH(TEXT("Output.pdf")));
L_PdfCompFree (hDocument);
L_FreeBitmap (&hBitmap);
return nRet;
}