PDFCompInsertNormal Example for Visual C++ 5.0 and later
void CTestPDFCOMP::OnInsertWithoutMRC()
{
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&m_pltRaster);
if (FAILED(hr))
return;
hr = CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&m_pltRasterIO);
if (FAILED(hr))
{
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}
hr = CoCreateInstance(CLSID_LEADPDFCompressor, NULL, CLSCTX_ALL, IID_ILEADPDFCompressor, (void**)&m_pltPDFComp);
if (FAILED(hr))
{
m_pltRasterIO->Release();
m_pltRasterIO = NULL;
m_pltRaster->Release();
m_pltRaster = NULL;
return;
}
m_pltRasterIO->LoadArray (m_pltRaster,"c:\\Image.cmp",0,0,1);
m_pltPDFComp->PDFCompInit (FALSE);
m_pltPDFComp->PDFCompInsertNormal(m_pltRaster);
m_pltPDFComp->PDFCompWrite ("c:\\output.pdf");
m_pltPDFComp->PDFCompFree ();
m_pltRasterIO->Release();
m_pltRaster->Release();
m_pltPDFComp->Release();
m_pltPDFComp = NULL;
m_pltRasterIO = NULL;
m_pltRaster = NULL;
}