I have an XML input file and XSLT code (XSL file) that I use to perform a transformation.
I want to generate PDF from them on Android (after a button click).
I was able to generate PDF on my computer with Apache FOP Java library.
I tried the same approach on Android, but fop.jar
has a lot of dependencies. I copied all of them to the Android's libs
, but I'm getting a lot of warnings from dx
described in this question and finally it's not working. These are the JARs:
avalon-framework-4.2.0.jar
serializer-2.7.0.jar
xml-apis-ext-1.3.04.jar
batik-all-1.7.jar
xalan-2.7.0.jar
xmlgraphics-commons-1.5.jar
commons-io-1.3.1.jar
xercesImpl-2.7.1.jar
commons-logging-1.0.4.jar
xml-apis-1.3.04.jar
So, what can I do to generate that PDF?
I see these options:
Make an empty Android project. Add the source code of that 10 JARs (they're all Open Source). Add stuff which they're importing, but it's not present in Android's Java libraries. Compile it to stand-alone JAR working on Android. Do you think it's possible to do? Seems like daunting task, maybe there's an easier way?
Do it in Cordova's JavaScript, instead of calling Java (with custom plugin). However, I couldn't find any suitable library.
Please suggest me the least time-consuming approach to generate that PDF or propose a different way.