#include "l_bitmap.h"
#include "lpdfComp.h"
L_LCMRC_API L_INT L_PdfCompInsertNormal(hDocHandle, pBitmap)
LCPDF_HANDLE hDocHandle; |
handle to an existing PDF document |
pBITMAPHANDLE pBitmap; |
pointer to bitmap handle |
Compresses the specified image, without segmenting it, and inserts the image in the PDF file in memory.
Parameter |
Description |
hDocHandle |
Handle to an existing PDF document. This handle is obtained by calling the L_PdfCompInit function. |
pBitmap |
Pointer to the bitmap handle that references the image to be inserted in the PDF document. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
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 For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Functions: |
|
Topics: |
|
|
This example inserts an image to pdf document without using the MRC.
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
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;
}