27 ms·
pdftk is a sort-of-C++ program that contains code like: #include "pdftk/com/lowagie/text/pdf/PdfReader.h" ... if( input_pdf_p->m_password
by amluto 9y ago
pdftk is a sort-of-C++ program that contains code like:
#include "pdftk/com/lowagie/text/pdf/PdfReader.h"
...
if( input_pdf_p->m_password.empty() ) {
reader= new itext::PdfReader( JvNewStringUTF( input_pdf_p->m_filename.c_str() ) );
PdfReader is actually java/pdftk/com/lowagie/text/pdf/PdfReader.java in the pdftk source distribution. Yes, this is a C++ program that's instantiating a Java class. As far as I can tell, what's actually going on is that all the Java code is compiled to C++-ABI-compatible .o files using GCJ and pdftk.cc links against them, giving a native program that is nonetheless mostly written in Java. Yikes!
Perhaps unsurprisingly, GCJ didn't get a huge amount of traction, and it has been deleted from the GCC tree entirely. Good riddance, maybe, but it makes it rather difficult to compile pdftk.
- jbn 9y agoSomeone should port all that C++ code (there's not that much of it, really) to Java, that would make it a lot easier to compile, wouldn't it?