Using PDFTron PDFNet with UCS4 Python

161 views
Skip to first unread message

Support

unread,
Aug 7, 2012, 7:25:21 PM8/7/12
to pdfne...@googlegroups.com
Q: I want to add a feature to our server that automates adding some PDFs together and adding some personalization of the
PDF books. So I thought of using PDFNet on the server for this.
 
I wrote a prototype that runs fine on my Mac OSX using Python, but on the server which is a Ubuntu 32-bit version, I get this error:
/var/www/cgi-bin/Lib/_PDFNetPython2.so: undefined symbol: PyUnicodeUCS2_AsUTF8String
 
It seems that the library is built for UCS2 and the server python version
(2.7.2) is expecting 4 byte unicode (See
 
any advice? or do you have a version that can run on UCS4 python?
 
----------------
A:
 
We have recently added support for UCS4 Python. You can download the onofficial build using the following links:
 

 Please see libinfo.txt for how to use _PDFNetPython2_ucs4.so. 

Support

unread,
Aug 7, 2012, 7:26:15 PM8/7/12
to pdfne...@googlegroups.com
Btw UCS4 Python will be supported for all future official PDFNet builds.

Support

unread,
Aug 8, 2012, 3:12:39 PM8/8/12
to pdfne...@googlegroups.com
Q:  Almost working....

I tested using python running under cgi-bin (i.e. triggered from a web browser), now I want to make it into a command line script using the exact same code, same files, same location, same parameters I am getting this error:

    outputDoc.Save(ofilename, 0)
  File "/home/ubuntu/personalize/Lib/PDFNetPython2.py", line 5255, in Save
    def Save(self, *args): return _PDFNetPython2.PDFDoc_Save(self, *args)

Exception: An error occurred while trying to save the file.

            The file might be locked, corrupt, or unavailable.

Detailed error:

            locale::facet::_S_create_c_locale name not valid

any idea what this might be and how comes it runs well as a cgi script?

----------------
A:
 
 
 

On Tuesday, August 7, 2012 4:25:21 PM UTC-7, Support wrote:
Reply all
Reply to author
Forward
0 new messages