Issue in creating PDFDoc with parameter Inputstream using pdfTron

578 Views Asked by At

While creating PDF document using pdftron, I am getting the error.

Code Snippet:

InputStream inputStream  = new FileInputStream("test.pdf");
                            PDFDoc doc = new PDFDoc(inputPdf);  
                            doc.initSecurityHandler();

Exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.pdftron.pdf.PDFDoc.MemStreamCreateMemFilt(J)J at com.pdftron.pdf.PDFDoc.MemStreamCreateMemFilt(Native Method) at com.pdftron.pdf.PDFDoc.(PDFDoc.java:246)

Can anybody help me ?

1

There are 1 best solutions below

0
On

You need to call PDFNet.initialize() before calling any other PDFNet API functions.

I assume though you will get the same error with that function, because the native PDFNetC.[dll|so] file is not available for some reason.

You need the following files

PDFNet.jar [JNI wrapper]
libPDFNetC.so [symbolic link]
libPDFNetC.so.x.y.z [actual SDK]

Please look at the RunTest.sh file in anyone of the samples, to see how the samples load the shared library.

If you have not already, I would also recommend you make sure the samples run fine for you, before integrating.