Running PDFNet for Python on Linux

56 views
Skip to first unread message

Support

unread,
Aug 6, 2013, 5:47:30 PM8/6/13
to pdfne...@googlegroups.com
Q:
 
I am running the example WebViewerConvert in python 2.7 on a 64-bit architecture (  Debian GNU/Linux 6.0 x86_64
 ) raises this error:

> ./RunTest.sh
Traceback (most recent call last):
  File "WebViewerConvert.py", line 11, in <module>
    from PDFNetPython2 import *
  File "/opt/PDFNetC64/Lib/PDFNetPython2.py", line 26, in <module>
    _PDFNetPython2 = swig_import_helper()
  File "/opt/PDFNetC64/Lib/PDFNetPython2.py", line 22, in swig_import_helper
    _mod = imp.load_module('_PDFNetPython2', fp, pathname, description)
ImportError: /opt/PDFNetC64/Lib/_PDFNetPython2.so: undefined symbol: PyCapsule_GetPointer

I have checked more than once that I'm using the binaries distributed PDFNetC64.tar.gz in What may be happening?
 
-----
A:
 

Python2 wrapper comes with _PDFNetPython2_ucs4.so to use PDFNetC with Python interpreters that are built with 4-byte Unicode. To use this wrapper, rename _PDFNetPython2_ucs4.so to _PDFNetPython2.so and replace the original file.

To check the width of Unicode used on your system:

 

When built with --enable-unicode=ucs4:

>>> import sys
>>> print sys.maxunicode
1114111
 

When built with --enable-unicode=ucs2:

>>> import sys
>>> print sys.maxunicode
65535

Support

unread,
Aug 9, 2013, 5:55:19 PM8/9/13
to pdfne...@googlegroups.com
 
FYI: The Python version is the problem, the production server is running with 2.6.6 I tested locally with Python 2.7.3 and it works perfect.
Reply all
Reply to author
Forward
0 new messages