This is My java.library.path:
java.library.path = C:\Program Files\Java\jdk1.7.0_51\bin
C:\WINDOWS\Sun\Java\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\system32
C:\Program Files\I.R.I.S. SA\iDRS_15_2_for_Win64_15_2_11_1717\lib\idrskr
.lib
C:\Program Files\I.R.I.S. SA\iDRS_15_2_for_Win64_15_2_11_1717\bin\iDRMSG
idgeDll.dll
C:\Program Files\I.R.I.S. SA\iDRS_15_2_for_Win64_15_2_11_1717\bin\iDRMSG
aderDll.dll
C:\Program Files\Java\jdk1.7.0_51\bin
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0
C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
C:\Program Files\Microsoft SQL Server\100\DTS\Binn
Still rror comes:
infile >> D:\pdf_upload\pre_idrs15_win_temporary_license_activation_tutorial.pdf
outFile >> D:\pdf_upload\processed\pre_idrs15_win_temporary_license_activation_tutorial.txt
Hello : This is java library path:(NICKRJ) C:\Program Files\Java\jdk1.7.0_51\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.7.0_51/jre/bin/server;C:/Program Files/Java/jdk1.7.0_51/jre/bin;C:/Program Files/Java/jdk1.7.0_51/jre/lib/amd64;C:\WINDOWS\system32;C:\Program Files\I.R.I.S. SA\iDRS_15_2_for_Win64_15_2_11_1717\lib\idrskrn15.lib;C:\Program Files\I.R.I.S. SA\iDRS_15_2_for_Win64_15_2_11_1717\bin\iDRMSGEBridgeDll.dll;C:\Program Files\I.R.I.S. SA\iDRS_15_2_for_Win64_15_2_11_1717\bin\iDRMSGEReaderDll.dll;C:\Program Files\Java\jdk1.7.0_51\bin;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;D:\WorkSet\New folder\eclipse_kepler\eclipse;;.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no iDRMSGEBridgeDll in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at com.bi.iDRMSGEBridgeDll.callOcr(iDRMSGEBridgeDll.java:78)
at com.bi.iDRMSGEBridgeDll.main(iDRMSGEBridgeDll.java:15)
Here is my Java JNI class:
package com.bi;
import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;
public class iDRMSGEBridgeDll
{
public native int iDRMSGEDll_Initialize(String strPropertiesFileName);
public native int iDRMSGEDll_VerifyLicense();
public native int iDRMSGEDll_ConvertFile(String strSourceFileName, String srcOutputFileName, String formatType);
public native int iDRMSGEDll_Finalize();
public static void main(String[] args)
{
//iDRMSGEBridgeDll.callOcr("bgimage.jpg","jpg","","d:\\","d:\\","4");
iDRMSGEBridgeDll.callOcr("pre_idrs15_win_temporary_license_activation_tutorial.pdf","pdf","","D:\\pdf_upload","D:\\pdf_upload\\processed","4");
/* System.loadLibrary("iDRMSGEBridgeDll");
iDRMSGEBridgeDll obj = new iDRMSGEBridgeDll();
if ( obj.iDRMSGEDll_Initialize("D:\\iris\\iDRSGEDll.properties") != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_Initialize success.");
if ( obj.iDRMSGEDll_VerifyLicense() != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_VerifyLicense success.");
if (obj.iDRMSGEDll_ConvertFile("E:\\UI changes File_by Shakti\\PDF\\S14-005_FRAMEWORK_AGREEMENT_FOR_ENGINE_MAINTENANCE_SERVICES_EASYJET[1].pdf",
"E:\\SK_Converted_Files\\MVP_CONTRACTS\\Southwest CFM56-7\\S14-005_FRAMEWORK_AGREEMENT_FOR_ENGINE_MAINTENANCE_SERVICES_EASYJET[1]\\S14-005_FRAMEWORK_AGREEMENT_FOR_ENGINE_MAINTENANCE_SERVICES_EASYJET[1].txt", "4" ) != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_ConvertFile 1 success.");
/*if (obj.iDRMSGEDll_ConvertFile("C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_200dpi.pdf",
"C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_200dpi.out", 4) != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_ConvertFile 2 success.");
if (obj.iDRMSGEDll_ConvertFile("C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_300dpi.pdf",
"C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_300dpi.out", 4) != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_ConvertFile 3 success.");
if (obj.iDRMSGEDll_ConvertFile("C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan2_300dpi.pdf",
"C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan2_300dpi.out", 4) != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_ConvertFile 4 success.");
obj.iDRMSGEDll_Finalize();
System.out.println("iDRMSGEDll_Finalize success.");
return;*/
}
public static String callOcr(String inputFile, String docType, String engineType, String filePath,String outputFolder,String type) throws RuntimeException
{
String message = "";
String formatType = type;
String inFile = filePath +"\\" +inputFile;
String outFile="";
if(type.equals("4"))
outFile = outputFolder +"\\"+inputFile.substring(0,inputFile.lastIndexOf("."))+".txt";
else if(type.equals("6"))
outFile = outputFolder +"\\"+inputFile.substring(0,inputFile.lastIndexOf("."))+".rtf";
else if(type.equals("9"))
outFile = outputFolder +"\\"+inputFile.substring(0,inputFile.lastIndexOf("."))+".pdf";
else
outFile = outputFolder +"\\"+inputFile.substring(0,inputFile.lastIndexOf("."))+".csv";
System.out.println("infile >> "+inFile);
System.out.println("outFile >> "+outFile);
System.out.println("Hello : This is java library path:(NICKRJ) " +System.getProperty("java.library.path"));
System.loadLibrary("iDRMSGEBridgeDll");
//System.load("C:\\Program Files (x86)\\I.R.I.S. SA\\iDRS_15_2_for_Win64_15_2_11_1717\bin\\iDRMSGEBridgeDll.dll");
//Runtime.getRuntime().loadLibrary("iDRMSGEBridgeDll");
iDRMSGEBridgeDll obj = new iDRMSGEBridgeDll();
try
{
if ( obj.iDRMSGEDll_Initialize("D:\\IRIS\\iDRSGEDll.properties") != 0 ) {
obj.iDRMSGEDll_Finalize();
// return ;
}
System.out.println("iDRMSGEDll_Initialize success.");
if ( obj.iDRMSGEDll_VerifyLicense() != 0 ) {
obj.iDRMSGEDll_Finalize();
// return;
}
System.out.println("iDRMSGEDll_VerifyLicense success.");
// formatType= JOptionPane.showInputDialog("Please input mark format type: ");
if (formatType!=null && formatType.equals("4")) {
obj.iDRMSGEDll_ConvertFile(inFile,
outFile, "4" );
obj.iDRMSGEDll_Finalize();
// return;
}
else if(formatType!=null && formatType.equals("6")) {
obj.iDRMSGEDll_ConvertFile(inFile,
outFile, "6" );
obj.iDRMSGEDll_Finalize();
// return;
}
else if(formatType!=null && formatType.equals("7")) {
obj.iDRMSGEDll_ConvertFile(inFile,
outFile, "7" );
obj.iDRMSGEDll_Finalize();
// return;
}
else if(formatType!=null && formatType.equals("9")) {
obj.iDRMSGEDll_ConvertFile(inFile,
outFile, "9" );
obj.iDRMSGEDll_Finalize();
// return;
}
else
{
message= "iDRMSGEDll_VerifyLicense failure";
}
System.out.println("iDRMSGEDll_ConvertFile 1 success.");
/*if (obj.iDRMSGEDll_ConvertFile("C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_200dpi.pdf",
"C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_200dpi.out", 4) != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_ConvertFile 2 success.");
if (obj.iDRMSGEDll_ConvertFile("C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_300dpi.pdf",
"C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan1_300dpi.out", 4) != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_ConvertFile 3 success.");
if (obj.iDRMSGEDll_ConvertFile("C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan2_300dpi.pdf",
"C:\\Software\\iDRS_15_1_7_2304\\sample_pdfs\\scan2_300dpi.out", 4) != 0 ) {
obj.iDRMSGEDll_Finalize();
return;
}
System.out.println("iDRMSGEDll_ConvertFile 4 success.");*/
obj.iDRMSGEDll_Finalize();
System.out.println("iDRMSGEDll_Finalize success.");
if(message.length()==0)
{
message = "success";
}
}
catch(Exception e)
{
e.printStackTrace();
message = e.getMessage();
}
return message;
}
}