Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, August 8, 2010 10:35:14 PM(UTC)

Siraj  
Siraj

Groups: Registered
Posts: 6


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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, August 9, 2010 4:58:29 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

The error message -9 means "Invalid file format", which in many cases means there's a missing file-format DLL. Are you sure you included all the needed DLLs with your application?
For example if you are loading or saving TIFF image you will need to include LFTIFU.DLL, LFFAXU.DLL and possibly other LF???U.DLL files (depends on the type of TIFF compression you use).

For more information, please see the help topic "Files to be Included with Your Application" in our C DLL help file.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.072 seconds.