I was searching for library which should convert .doc/.docx to .pdf in android platform.
I got PdFTron android sdk,in that they have given libPDFNetC.so file.
For Conversion, there is class called Convert, inside that there is a method toPDF(), in that method they have internally called native method FileToPdf().I tried that code but unable to call that native method and was getting errors
I want to know that if there is existing .so file present with you and if you want to call native method which is present in .so file then is there need to use JNI?. i dont know much about JNI. any help.
You need to make sure the .so file that maps to the native interface is available on your system, and can be found by Java.
There should be a call like
System.loadLibrary("<libraryname>")
orSystem.load("/path/to/libs/lib<libraryname>.so")
somewhere in your Java code. That will instruct the JVM to search for the library with the given name and load it.System.load("/path/to/libs/lib<libraryname>.so")
will just look for the file specified as argument, and load it.System.loadLibrary("<libraryname.")
will look in the configured library path for a library with the namelib<libraryname>.so
. The library path is taken from the system variablejava.library.path
.Also make sure that the library version you are loading is compatible with the Java JNI mapping!