lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Heimes <li...@cheimes.de>
Subject Wrapping PDFBox with JCC
Date Sat, 28 Feb 2009 17:22:37 GMT
Hello!

I'm trying to wrap pdfbox with JCC and I run into multiple issues. At
first the list of required jars kept on growing. I had to remove two
packages and one class to keep the list small. Is there a better way to
omit some packages from getting wrapped? --exclude didn't do what I was
expecting it to do.

Once I got the wrappring right I run into another issue. The generated
code failed to compile:

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC -DPYTHON=1 -I/usr/lib/jvm/java-6-sun/include
-I/usr/lib/jvm/java-6-sun/include/linux -Ibuild/_pdfbox
-I/usr/lib/python2.5/site-packages/JCC-2.1-py2.5-linux-x86_64.egg/jcc/sources
-I/usr/include/python2.5 -c build/_pdfbox/__init__.cpp -o
build/temp.linux-x86_64-2.5/build/_pdfbox/__init__.o
-fno-strict-aliasing -Wno-write-strings
cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig
für Ada/C/ObjC, aber nicht für C++
In file included from build/_pdfbox/__init__.cpp:597:
build/_pdfbox/com/ibm/icu/impl/duration/impl/XMLRecordReader.h:52:
Fehler: expected unqualified-id before »const«
build/_pdfbox/com/ibm/icu/impl/duration/impl/XMLRecordReader.h:52:
Fehler: expected `)' before »const«
In file included from build/_pdfbox/__init__.cpp:598:
build/_pdfbox/com/ibm/icu/impl/duration/impl/XMLRecordWriter.h:54:
Fehler: expected unqualified-id before »const«
build/_pdfbox/com/ibm/icu/impl/duration/impl/XMLRecordWriter.h:54:
Fehler: expected `)' before »const«
In file included from
build/_pdfbox/org/apache/pdfbox/examples/util/PrintImageLocations.h:4,
                 from build/_pdfbox/__init__.cpp:2497:
...


XMLRecordReader.h
-----------------
...
XMLRecordReader(const XMLRecordReader& obj) : java::lang::Object(obj) {}

jboolean bool(const java::lang::String&) const; # <<< line 52
JArray<jboolean> boolArray(const java::lang::String&) const;
jchar character(const java::lang::String&) const;
JArray<jchar> characterArray(const java::lang::String&) const;
jboolean close() const;
...

I'm using JCC 2.1 (from pypi.python.org) on an AMD64 Linux box with
Python 2.5 and java-6-sun-1.6.0.10.


Project
=======
homepage: http://incubator.apache.org/pdfbox/
svn repository: http://svn.apache.org/repos/asf/incubator/pdfbox/trunk


Remove some files and packages
==============================
rm -r src/main/java/org/apache/pdfbox/ant
rm -r src/main/java/org/apache/pdfbox/searchengine
rm
src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java


Patch one file
==============

src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandlersManager.java
@@ -21,8 +21,6 @@
 import java.security.Security;
 import java.util.Hashtable;

-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-
 /**
  * This class manages security handlers for the application. It follows
the singleton pattern.
  * To be usable, security managers must be registered in it. Security
managers are retrieved by
@@ -69,10 +67,6 @@
                 StandardSecurityHandler.FILTER,
                 StandardSecurityHandler.class,
                 StandardProtectionPolicy.class);
-            this.registerHandler(
-                PublicKeySecurityHandler.FILTER,
-                PublicKeySecurityHandler.class,
-                PublicKeyProtectionPolicy.class);
         }
         catch(Exception e)
         {
@@ -144,7 +138,6 @@
         {
             instance = new SecurityHandlersManager();
         }
-        Security.addProvider(new BouncyCastleProvider());

         return instance;
     }


build
=====

python2.5 -m jcc.__main__ \
    --jar lib/apache-pdfbox-0.8.0-incubator-dev.jar \
    --jar external/junit.jar \
    --jar external/FontBox-0.2.0-dev.jar \
    --jar external/JempBox-0.2.0.jar \
    --jar external/icu4j-4_0.jar \
    --package java.lang \
    --python pdfbox --version 0.8.0 --files 2 --build

Mime
View raw message