PDFNet python binding does not working with UCS4 Python

Skip to first unread message

Phalgun Guduthur

Apr 8, 2015, 4:09:42 PM4/8/15
to pdfne...@googlegroups.com
When I try to run the samples using Python 2.7 (default Python on Ubuntu 14.04, ucs4), I get the following error - 

AddImageTest running
Traceback (most recent call last):
  File "AddImageTest.py", line 9, in <module>
    from PDFNetPython import *
  File "/home/ubuntu/pdftron/PDFNetWrappersLinux64/PDFNetC/Lib/PDFNetPython.py", line 28, in <module>
    _PDFNetPython = swig_import_helper()
  File "/home/ubuntu/pdftron/PDFNetWrappersLinux64/PDFNetC/Lib/PDFNetPython.py", line 24, in swig_import_helper
    _mod = imp.load_module('_PDFNetPython', fp, pathname, description)
ImportError: /home/ubuntu/pdftron/PDFNetWrappersLinux64/PDFNetC/Lib/_PDFNetPython.so: undefined symbol: PyUnicodeUCS2_AsUTF8String

We have purchased a license and it is imperative that we use Python with UCS4 only (as UCS2 does not work with the encoding we use). I read in a previous thread [1] that a build that supports Python compiled with UCS4 will be provided. 

Could you please share a build that runs with default Python (UCS4)? 



Apr 8, 2015, 6:39:33 PM4/8/15
to pdfne...@googlegroups.com
Hi, to get UCS4 compatible Python wrapper, you can follow the instructions here.


Building UCS2 wrappers and UCS4 wrappers are identical processes, as long as CMake is able to find the correct header and configuration of that Python variant.

Reply all
Reply to author
0 new messages