intoolswetrust / jsignpdf

PDF signing software written in Java. It supports visible signatures, timestamping, certificate verification and many other cool features
https://intoolswetrust.github.io/jsignpdf/
Other
323 stars 121 forks source link

How do you build this library? #3

Closed jongbor closed 10 years ago

jongbor commented 10 years ago

I'm using ant 1.8.2 on Windows. I'm not very experienced building java projects, so I can only guess how to proceed. Executing ant with no parameters throws a FileNotFoundException on line 47 since ../jsignpdf-itxt/src/build.xml doesn't exist (and indeed, I can't find it in the source code).

There's a nbproject folder which suggests a NetBeans project but I couldn't open it with NetBeans either.

So I'm stumped. What is the correct way of building this library?

kwart commented 10 years ago

You have to checkout not only jsignpdf, but also jsignpdf-itxt project from the GitHub: https://github.com/kwart/jsignpdf-itxt/

jongbor commented 10 years ago

Thanks. In case anyone is interested, these are the steps I followed to build the library on Windows

  1. Checkout jsignpdf and jsignpdf-txt and place them in the same folder. The folder for jsignpdf-txt should be named jsignpdf-txt.
  2. Edit jsignpdf/build.properties. Download and install LibreOffice and InnoSetup and then edit ooo.exec and innosetup.exec to match the installed versions.
  3. I had to convert lib-build/launch4j-3.0.2-win32.zip to lib-build/launch4j-3.0.2-win32.tgz by uncompressing the former and then creating the tgz (tar czvf launch4j-3.0.2-win32.tgz launch4j). Otherwise, I'd get "jsignpdf\build.xml:249: Error while expanding jsignpdf\lib-build\launch4j-3.0.2-win32.zip java.io.IOException: Not in GZIP format" in the next step. After creating the new archive, edit build.properties, the property "launch4j.zip" should now point to "launch4j-3.0.2-win32.tgz"
  4. Open a command line prompt, cd to the jsignpdf folder and run ant (http://ant.apache.org/)
  5. At this point I get "jsignpdf\build.xml:402: Execute failed: java.io.IOException: Cannot run program "unsorted\iscc": CreateProcess error=2". Not sure about the cause of the failure since the file exists, even though it's a shell script that invokes wine so it doesn't look like it would work on Windows. It doesn't seem essential either, since it generates an installer, so this can be done manually afterwards if you really need it. Anyway, by now the relevant binaries have already been built and can be found in "jsignpdf\build\jsignpdf-1.5.1".
kwart commented 10 years ago

Closing the question. Thanks for the steps. Currently the jsignpdf-itxt is a subfolder of jsignpdf itself so it's not necessary to clone 2 project anymore.