Question:
I am trying to use your Python wrapper on latest Ubuntu, but get the following error.
CRITICAL libPDFNetC.so: cannot open shared object file: No such file or directory
There is a workaround; if I try to import libPDFNetC, catch the exception, and then try to import PDFNetPython, it will work. Meaning this code works:
site.addsitedir(configwrapper.pdftron_path) try: import libPDFNetC except: pass from PDFNetPython import PDFDoc, Annot
Answer:
It looks like you are trying to import the libPDFNet.so file from Python, which you don’t want to do. Here is the first lines of code from all our Python samples.
import site site.addsitedir("../../../PDFNetC/Lib") import sys from PDFNetPython import *
Where PDFNetC/Lib contains both libPDFNet.so and PDFNetPython.py.
Note, it does not try to import libPDFNetC.so.
libPDFNetC.so has a pure C interface, which PDFNetPython.py communicates with. Your python code just communicates with PDFNetPython.py.