I have write a small program that read PDF file and convert it to image. I get the file information using LFile::getInfo(); function. but this line generate the -9 error code. Although i have include the LTFile dll and lib in our project. The code that i have included in my project is given below.
//////////////////////////////////////////
L_INT nReturn = 0;
FILEINFO FileInfo;
memset(&FileInfo, 0, sizeof(FILEINFO));
FileInfo.uStructSize = sizeof(FILEINFO);
LOADFILEOPTION pLoadFile;
pLOADFILEOPTION pLoad;
SAVEFILEOPTION pSaveFile;
FILEPDFOPTIONS PDF;
memset(&PDF, 0, sizeof(FILEPDFOPTIONS));
memset(&pSaveFile, 0, sizeof(SAVEFILEOPTION));
pSaveFile.uStructSize = sizeof(SAVEFILEOPTION);
memset(&pLoadFile, 0, sizeof(LOADFILEOPTION));
pLoadFile.uStructSize = sizeof(LOADFILEOPTION);
pSAVEFILEOPTION pSave;
pSave = &pSaveFile;
pLoad = & pLoadFile;
pFILEINFO finfo;
finfo = & FileInfo;
pFILEPDFOPTIONS pPDF;
pPDF = &PDF;
LFile LeadFile =NULL ;
LFileSettings FilePDF;
L_TCHAR* InPutPath = TEXT("C:\\BUNU.pdf");
CString OutPut = _T("C:\\BUST\\WorkSpaceAndStructures%d");
LeadFile.SetFileName(InPutPath);
//FilePDF.GetPDFOptions(pPDF, sizeof(LOADFILEOPTION));
LBase::LoadLibraries(LT_ALL_LEADLIB);
LeadFile.GetLoadedLibraries();
nReturn = LeadFile.GetInfo(finfo, sizeof(FILEINFO),FILEINFO_TOTALPAGES, NULL);
for(L_INT page =1; page <br /><br />Forum: Image Processing<br />Posted: Aug 9, 12:59 AM [GMT -5]<br />Post Subject: <b><a href="/CS/forums/35128/ShowPost.aspx#35128" target="_blank" title="/CS/forums/35128/ShowPost.aspx#35128">Re: LTFIL dll is not loaded</a></b><br />Post author: <a href="/CS/user/Profile.aspx?UserID=31225" target="_blank" title="/CS/user/Profile.aspx?UserID=31225">Siraj</a><hr>Maen Hasan @....Thanks a lot for your kind reply. I have included the line "LBase::LoadLibraries(LT_ALL_LEADLIB)" in my code. The dll not loaded error is finished, but another i.e. -9 is generated. please help me in fixing this problem. My code is that,
//////////////////////////////////////////////////////////
L_INT nReturn = 0;
static FILEINFO FileInfo;
memset(&FileInfo, 0, sizeof(FILEINFO));
FileInfo.uStructSize = sizeof(FILEINFO);
LOADFILEOPTION pLoadFile;
pLOADFILEOPTION pLoad;
SAVEFILEOPTION pSaveFile;
memset(&pSaveFile, 0, sizeof(SAVEFILEOPTION));
pSaveFile.uStructSize = sizeof(SAVEFILEOPTION);
memset(&pLoadFile, 0, sizeof(LOADFILEOPTION));
pLoadFile.uStructSize = sizeof(LOADFILEOPTION);
pSAVEFILEOPTION pSave;
pSave = &pSaveFile;
pLoad = & pLoadFile;
pFILEINFO finfo;
finfo = & FileInfo;
LFile LeadFile =NULL ;
L_TCHAR* InPutPath = TEXT("C:\\WorkSpaceAndStructures.rtf");
CString OutPut = _T("C:\\BUST\\WorkSpaceAndStructures%d");
LBase::LoadLibraries(LT_ALL_LEADLIB);
LeadFile.SetFileName(InPutPath);
nReturn = LeadFile.GetInfo(finfo, sizeof(FILEINFO),FILEINFO_TOTALPAGES, NULL);
for(L_INT page =1; page <= FileInfo.TotalPages; page++)
{
pLoadFile.PageNumber = page;
OutPut.Format(OutPut, page);
OutPut = OutPut+".jpg";
LPTSTR lpszData = new TCHAR[OutPut.GetLength()+1];
_tcscpy(lpszData , OutPut);
L_TCHAR* OutPutPath=lpszData;
nReturn= LeadFile.FileConvert(OutPutPath, InPutPath ,FILE_JPEG,0,0,24,QMS,pLoad,pSave,finfo);
delete[] lpszData;
}
//////////////////////////////////////////////////////////
the code is generated at
nReturn = LeadFile.GetInfo(finfo, sizeof(FILEINFO),FILEINFO_TOTALPAGES, NULL); and
nReturn= LeadFile.FileConvert(OutPutPath, InPutPath ,FILE_JPEG,0,0,24,QMS,pLoad,pSave,finfo);
Please help me
Thanks